-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Github actions don't work for pull requests created that involve a fork. #17324
Comments
This behavior has changed recently, it should work using the |
It's currently implemented using
|
I think what @ScottBrenner said was right. The |
I see now that you'e referring to this part of the docs:
Which is unusual because when I checked at the time they were still being triggered from the forked repository, and the action was failing because of the rule.
@frextrite what leads you to believe that the action is only triggered on a merge? Currently there's nothing in the way the workflow is configured to restrict when it should run: gutenberg/.github/workflows/pull-request-automation.yml Lines 1 to 14 in 9030e51
There's some JavaScript logic so that the action only tries to add a label when a PR is opened: gutenberg/packages/project-management-automation/lib/index.js Lines 21 to 25 in 9030e51
|
Any update / change to this? |
This thread seems to have the latest info from Github as of yesterday (31st Oct '19) - https://github.community/t5/GitHub-Actions/Github-Workflow-not-running-from-pull-request-from-forked/td-p/32979:
|
This can now be resolved using the new |
That's great, thanks for pointing that out @skorasaurus. |
I've made a PR #26876 . |
Reference issue: WordPress/gutenberg#17324 (comment) Because the GitHub Action runs on our repository, it doesn't have permission to modify a community pull request, as those belong to the original forked repository. This PR solves that by running the Action in the context of the original repository, by triggering from the `pull_request_target` event, instead of `pull_request`.
Reference issue: WordPress/gutenberg#17324 (comment) Because the GitHub Action runs on our repository, it doesn't have permission to modify a community pull request, as those belong to the original forked repository. This PR solves that by running the Action in the context of the original repository, by triggering from the `pull_request_target` event, instead of `pull_request`.
[Github actions don't work for pull requests created that involve a fork.](WordPress/gutenberg#17324)
Describe the bug
As explained in the following link, our github actions won't work correctly on PRs where a fork is involved:
https://github.community/t5/GitHub-Actions/GitHub-Action-workflow-is-executed-for-a-PR-from-a-forked-repo/m-p/29579
TLDR - For security reasons, the action itself is run on the forked repo instead of the main repo, and so has no privileges for things like adding labels or milestones.
This is particularly an issue with the First-Time Contributor action, where the majority of PRs that involve first time contributors are from forks.
Ideally we'd be able to find a workaround for this. I've seen it mentioned that the
push
event can be used. Not entirely sure how that works for forks, perhaps opening the pull request triggers a push event as the base repo has a ref to the head of the branch pushed?The text was updated successfully, but these errors were encountered: