ci: skip pr comment workflow for forked pulled requests#526
Merged
Conversation
GitHub's GITHUB_TOKEN has read-only access for pull_request events from forks, so the peter-evans/create-or-update-comment step was failing with "Resource not accessible by integration". Split the commenting logic into a separate workflow_run-triggered workflow (pr-comment.yml) that runs in the base repo context where GITHUB_TOKEN has full write access. The CI workflow now saves PR metadata (PR number, SHA, run ID, artifact ID) as a short-lived artifact which the comment workflow downloads and uses to post/update the PR comment.
Contributor
Build ReportPlease note:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As forked prs lack the required permissions.
And the repo's security may be (slightly) compromised even if implement mitigations
as recommended here: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
For example, one must remember that the published artifacts by the forked PR (*.vsix) can themselves
contain malicious code and should not be freely installed without oversight.
Additionally keeping this PR Comments workflow for forked PRs is not a high priority
as its an optional helper flow, and forked PRs are not common on this repo.