Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 11 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

Secret variables aren't available on PR by default.

 

Here is discussion about possibility to pass secret variable to PR: https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/30678#M508

Highlighted
Pilot Lvl 1
Message 12 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

I tried this with two accounts that both have Actions enabled:

 

# Create repo for user A
# Fork into B's account

# Add a branch, create a PR back into A

 

... then a `push` action will run in B, but the results will not be shown in the PR at A.

 

Or am I misunderstanding something?

Highlighted
Copilot Lvl 2
Message 13 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

Same problem.

Both account with GitHub Action CI enabled but nothing is triggered on the upstream when a PR is made from a fork..

Highlighted
Copilot Lvl 2
Message 14 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

Can someone elaborate on whether the marked solution is the current behaviour or the future intended behaviour?

 

Creating a PR from a fork that has Actions enabled currently does not trigger an actions workflow run on upstream but instead triggers the workflow run on the fork

Highlighted
Ground Controller Lvl 2
Message 15 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

Hi,

 

Is this true for private repos?

 

No matter which combination of advice I take I cannot get my workflow to run from an upstream PR when the branch being PR'd is from a fork (though the PR is open in the upstream repo). I use a workflow for CI to test the PR'd code.

 

I see that the docs state:

"Note: Workflows do not run on private base repositories when you open a pull request from a forked repository."

 

What am I not understanding as this seems ironic to me given that permissions have to be granted to even gain access to the repo? I.e. if I'm ok with them having access, why should I not be ok with them using a workflow?

 

Thanks

Highlighted
Copilot Lvl 2
Message 16 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

Same confusion here!

I have manually added "collaborators" to my private repo, so I should trust them to send PRs back!

Now I even cannot get the CI on a forked repo working...

 

Did anyone figure out a workaround for this annoying issue? The only solution I can think of is 1) asking collaborators to send PRs to a dev branch, 2) I merge PRs to trigger CI with a "push to dev" event, and 3) I rebase master onto dev regularly.

Highlighted
Copilot Lvl 3
Message 17 of 17

Re: Run a GitHub action on `pull_request` for PR opened from a forked repo

We use local action runners. Does this mean, that every person who has a fork of that repository has to set his own local action runner?