Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions actions/package-size/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For forks the repo name will have a different owner and will not match.

Copy link
Member Author

@kinyoklion kinyoklion Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not 100% sure if a composite can access this, so we will hopefully find out from the CI run.

Seemed to work.

uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{ inputs.pr_number }}
Expand All @@ -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 }}
Expand Down