ci: change event triggers for benchmark CI to include forks #840
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.
What does this PR introduce?
🤖 CI
This PR updates the GitHub Actions workflow event trigger from
pull_request
topull_request_target
. Below are the key differences and reasons for this change:Differences between
pull_request
andpull_request_target
Context of Execution:
pull_request
: The workflow runs in the context of the pull request itself, meaning it uses the code from the feature branch of the fork.pull_request_target
: The workflow runs in the context of the base repository, using the code from the base branch to which the PR is targeted.Access to Secrets:
pull_request
: Has limited access to secrets, particularly when the PR is from a forked repository. This is a security measure to prevent exposing secrets to potentially unsafe code in forks.pull_request_target
: Has access to all secrets of the base repository, even for PRs from forks.Why the Change Enables Comment Posting from Forks
Permission to Comment:
pull_request_target
, the workflow gains the necessary write permissions to post comments on PRs. This is essential for PRs originating from forks, aspull_request
does not provide sufficient permissions for this action.Access to Repository Secrets:
pull_request
for forked PRs.Security Considerations:
PR Checklist
npm run lint
&&npm run lint:solidity
(solhint)npm run format
(prettier)npm run build
npm run test