mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-05 04:35:24 +00:00
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: Metrics Comment
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Build"]
|
|
types:
|
|
- completed
|
|
|
|
jobs:
|
|
post-comment:
|
|
runs-on: ubuntu-latest
|
|
if: >
|
|
github.event.workflow_run.event == 'pull_request' &&
|
|
github.event.workflow_run.conclusion == 'success'
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Download Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
run-id: ${{ github.event.workflow_run.id }}
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
name: metrics-comment
|
|
|
|
- name: Read PR Number
|
|
id: pr_number
|
|
run: |
|
|
if [ -f pr_number.txt ]; then
|
|
echo "number=$(cat pr_number.txt)" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Post Code Metrics as PR Comment
|
|
if: steps.pr_number.outputs.number != ''
|
|
uses: marocchino/sticky-pull-request-comment@v2
|
|
with:
|
|
header: code-metrics
|
|
path: metrics_compare.md
|
|
number: ${{ steps.pr_number.outputs.number }}
|