Fix workflow errors on PRs from fork repos #383
Merged
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.
With this PR, I try to fix workflow errors on a PR from a fork repository since some workflows need to write permission to the PR or acceess to secrets to push an automatically created commit.
One way to resolve them is change the trigger event from pull_request to pull_request_target, just as this PR does.
Note, according to the official document, that can be insecure against stealing secrets or running a malicious code.
So, further changes will be required to increase security in the future since this is first aid to the errors.
Pull Request Checklist
Read the CONTRIBUTING.md file for detailed information.
Please don't
#ifdef
s or other means.