Skip to content

Commit b8a2331

Browse files
authored
chore: No package-size comments on forks. (#654)
1 parent 773d02c commit b8a2331

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

actions/package-size/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ runs:
3131
echo "PACK_SIZE=$PACK_SIZE" >> $GITHUB_ENV
3232
3333
- name: Find Size Comment
34+
# Only do commenting on non-forks. A fork does not have permissions for comments.
35+
if: github.event.pull_request.head.repo.full_name == github.repository
3436
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e
3537
id: fc
3638
with:
@@ -39,7 +41,7 @@ runs:
3941
body-includes: '${{ inputs.package_name }} size report'
4042

4143
- name: Create comment
42-
if: steps.fc.outputs.comment-id == ''
44+
if: steps.fc.outputs.comment-id == '' && github.event.pull_request.head.repo.full_name == github.repository
4345
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
4446
with:
4547
issue-number: ${{ inputs.pr_number }}
@@ -50,7 +52,7 @@ runs:
5052
Size limit: ${{ inputs.size_limit }}
5153
5254
- name: Update comment
53-
if: steps.fc.outputs.comment-id != ''
55+
if: steps.fc.outputs.comment-id != '' && github.event.pull_request.head.repo.full_name == github.repository
5456
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
5557
with:
5658
comment-id: ${{ steps.fc.outputs.comment-id }}

0 commit comments

Comments
 (0)