Skip to content

Commit acef8d4

Browse files
committed
Run PR comment posting as separate job with appropriate permissions.
1 parent 0ddc036 commit acef8d4

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/check-binary-size.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020
TEST_MAIN_RS: foo.rs
2121
BASE_COMMIT: ${{ github.event.pull_request.base.sha }}
2222
HEAD_COMMIT: ${{ github.event.pull_request.head.sha }}
23+
outputs:
24+
binary-size-reference: ${{ steps.size-reference.outputs.test-binary-size }}
25+
binary-size-updated: ${{ steps.size-updated.outputs.test-binary-size }}
2326
steps:
2427
- name: Print info
2528
run: |
@@ -74,11 +77,18 @@ jobs:
7477
main-rs: ${{ env.TEST_MAIN_RS }}
7578
rustc-dir: ${{ env.RUSTC_DIR }}
7679
id: size-updated
80+
report:
81+
name: Report binary size changes
82+
runs-on: ubuntu-latest
83+
needs: measure
84+
permissions:
85+
pull-requests: write
86+
steps:
7787
- name: Post a PR comment if the size has changed
7888
uses: actions/github-script@v6
7989
env:
80-
SIZE_REFERENCE: ${{ steps.size-reference.outputs.test-binary-size }}
81-
SIZE_UPDATED: ${{ steps.size-updated.outputs.test-binary-size }}
90+
SIZE_REFERENCE: ${{ needs.measure.outputs.binary-size-reference }}
91+
SIZE_UPDATED: ${{ needs.measure.outputs.binary-size-reference }}
8292
with:
8393
script: |
8494
const reference = process.env.SIZE_REFERENCE;

0 commit comments

Comments
 (0)