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

switch workflow trigger to pull_request_target #132

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

mandelsoft
Copy link
Contributor

What this PR does / why we need it:

According to the Github Action Docu

This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows your workflow to do things like label or comment on pull requests from forks. Avoid using this event if you need to build or run code from the pull request.

the trigger option for the linter and test workflow should be set to pull_request_target to run the workflow for PRs originating from forks based on the workflow definition of the base branch, instead of the provided content.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

@mandelsoft mandelsoft force-pushed the mandelsoft/workflow branch from b946ce7 to cbaf043 Compare October 4, 2022 09:34
@mandelsoft mandelsoft changed the title Mandelsoft/workflow @mandelsoft switch workflow trigger to pull_request_target Oct 4, 2022
@mandelsoft mandelsoft changed the title @mandelsoft switch workflow trigger to pull_request_target switch workflow trigger to pull_request_target Oct 4, 2022
Skarlso
Skarlso previously approved these changes Oct 4, 2022
@mandelsoft
Copy link
Contributor Author

strange, now it is not running for local PRs. Should I add both events?

@yitsushi
Copy link
Contributor

yitsushi commented Oct 4, 2022

I would try:

  1. Leave it as pull_request
  2. Add push
on: [pull_request, push]
  1. Change settings to
    image

push: run on all commits, it's good in general because that way it will be executed on main after merge too and it's easy to re-trigger the PR checker by force-pushing the same commit (git commit commit --amend --no-edit && git push -f)

@yitsushi
Copy link
Contributor

yitsushi commented Oct 4, 2022

It's running \o/ the PR checkers are running

@mandelsoft
Copy link
Contributor Author

Done, but now we have the execution twice

1 similar comment
@mandelsoft
Copy link
Contributor Author

Done, but now we have the execution twice

yitsushi
yitsushi previously approved these changes Oct 4, 2022
Skarlso
Skarlso previously approved these changes Oct 4, 2022
@mandelsoft mandelsoft dismissed stale reviews from Skarlso and yitsushi via ceaa2a8 October 4, 2022 10:16
@mandelsoft mandelsoft force-pushed the mandelsoft/workflow branch from 05e3355 to ceaa2a8 Compare October 4, 2022 10:16
@yitsushi yitsushi merged commit 6c90938 into main Oct 4, 2022
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.

3 participants