diff options
| author | Ha Thach <[email protected]> | 2025-12-12 14:46:48 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-12 14:46:48 +0700 |
| commit | 185839e5c5f80a71ad18470d0d8e84e0a703067b (patch) | |
| tree | cef09eeda20078c96f5a67b407103b3ba3bf6070 /.github | |
| parent | 64820791516b4001cb169f095588ccb52eb35ea8 (diff) | |
| parent | e65e79bb81fcc87e5bb6c1ef83b39d480c785764 (diff) | |
Merge pull request #3402 from hathach/more-size-reduce-edpt-stream
refactor, clean up to reduce size
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build.yml | 13 | ||||
| -rw-r--r-- | .github/workflows/metrics_comment.yml | 38 |
2 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d94a3b9b..c062aca46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,6 +130,19 @@ jobs: cp metrics.md metrics_compare.md fi + - name: Save PR number + if: github.event_name == 'pull_request' + run: echo ${{ github.event.number }} > pr_number.txt + + - name: Upload Metrics Comment Artifact + if: github.event_name == 'pull_request' + uses: actions/upload-artifact@v5 + with: + name: metrics-comment + path: | + metrics_compare.md + pr_number.txt + - name: Post Code Metrics as PR Comment if: github.event_name != 'push' uses: marocchino/sticky-pull-request-comment@v2 diff --git a/.github/workflows/metrics_comment.yml b/.github/workflows/metrics_comment.yml new file mode 100644 index 000000000..2f1b0d631 --- /dev/null +++ b/.github/workflows/metrics_comment.yml @@ -0,0 +1,38 @@ +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 }} |
