From a49a3b8d89aded37a683f2c1e0259b6a1e0bda2c Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:06:53 -0700 Subject: [PATCH] chore: No package-size comments on forks. --- actions/package-size/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/actions/package-size/action.yml b/actions/package-size/action.yml index 4413259e95..ba4af89027 100644 --- a/actions/package-size/action.yml +++ b/actions/package-size/action.yml @@ -31,6 +31,8 @@ runs: echo "PACK_SIZE=$PACK_SIZE" >> $GITHUB_ENV - name: Find Size Comment + # Only do commenting on non-forks. A fork does not have permissions for comments. + if: github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e id: fc with: @@ -39,7 +41,7 @@ runs: body-includes: '${{ inputs.package_name }} size report' - name: Create comment - if: steps.fc.outputs.comment-id == '' + if: steps.fc.outputs.comment-id == '' && github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: issue-number: ${{ inputs.pr_number }} @@ -50,7 +52,7 @@ runs: Size limit: ${{ inputs.size_limit }} - name: Update comment - if: steps.fc.outputs.comment-id != '' + if: steps.fc.outputs.comment-id != '' && github.event.pull_request.head.repo.full_name == github.repository uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 with: comment-id: ${{ steps.fc.outputs.comment-id }}