Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflow not working properly when running from fork #2595

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

GoldenJaden
Copy link
Contributor

@GoldenJaden GoldenJaden commented Jan 23, 2024

Changed trigger from "pull_request" to "pull_request_target", which will grant write permissions and secrets to workflow (even from forks).

Documented this warning in the code:

Caution: 
the use of "pull_request_target" trigger allows to successfully
run workflow even when triggered from a fork. The trigger grants
access to repo's secrets and gives write permission to the runner.
This can be used to run malicious code on untrusted PR, so, please
DO NOT checkout any PR's ongoing commits (aka github.event.pull_request.head.sha)
while using this trigger.

@neSpecc neSpecc merged commit 7ff5faa into next Feb 28, 2024
6 checks passed
@neSpecc neSpecc deleted the fix/run-workflow-from-forks branch February 28, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants