Skip to content

GitHub Action workflow is executed for a PR from a forked repo if the PR changes the workflow file #25198

Answered by lee-dohm
huynguyendev asked this question in Actions
Discussion options

You must be logged in to vote

It allows bad actors to run their own scripts, but only in the context of their own repository. Basically, it works like this:

  1. A repo named foo/bar exists
  2. I fork the repository foo/bar to lee-dohm/bar
  3. I make a change to a workflow on a branch in lee-dohm/bar and open a pull request to foo/bar

Leaving aside the “which repo is in the Actions beta” part, the workflow executes in lee-dohm/bar even though the result is visible in foo/bar. This means that I can’t create a workflow that emails the secrets of foo/bar to me by creating a PR because it would email me the secrets of lee-dohm/bar.

I hope that helps to clarify things.

Replies: 8 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@amithm7
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
8 participants