-
Notifications
You must be signed in to change notification settings - Fork 69
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
Only run CTS issue workflow when opening PRs; run on base branch #597
Conversation
Turns out the `pull_request` trigger by default also runs when PRs are updated or re-opened. Change to only run on the `opened` activity.
This allows the workflow to access repository secrets even if the triggering PR originates from a fork. This has some security implications, see the comment within the workflow.
I marked this "editorial" because it does not change the specification. Therefore, I think it could be merged without WG approval. @psalz: I'll wait to hear from you before I merge this. Let me know when you think it is ready. |
Should be good to go! |
Merging as editorial |
Only run CTS issue workflow when opening PRs; run on base branch
Only run CTS issue workflow when opening PRs; run on base branch (cherry picked from commit 976ac9b)
Only run CTS issue workflow when opening PRs; run on base branch (cherry picked from commit 976ac9b)
Turns out the
pull_request
trigger by default also runs when PRs are updated or re-opened. Change to only run on theopened
activity.Additionally, I forgot that using the
pull_request
trigger doesn't allow the workflow to access repository secrets when the triggering PR originates from a fork. Thankfully there is apull_request_target
trigger to remedy this, which runs the workflow in the context of the base branch (i.e., changes to the workflow itself aren't executed). This is fine for our use case, as we don't need to access the PR's contents within the workflow.(Side note: I marked this asEdit: I've now limited the workflow to only run when changes are made inside theeditorial
to not run the workflow - maybe we need another label for these kinds of infrastructure changes).adoc
directory.