How to auto merge pr from fork #26874
-
I have been working on a project like first-contribution. Where newcomers have to commit a new file with their name into the repo. For this, I am trying to make a GitHub action which auto-merge the pr if every check has passed. I am using It gives After reading this I have ticked first two options under organization settings but it’s still not working and gives the same error. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
What “on” event are you using? |
Beta Was this translation helpful? Give feedback.
-
Assuming you mean your “first-bit” repo then you need to use For your checkout you want to make sure you checkout the PR content:
|
Beta Was this translation helpful? Give feedback.
-
Yes, I can reproduce the same issue. Looks like, the feature “Run workflows from fork pull requests” does not work as designed. You can follow this issue ticket and add your comments to it. |
Beta Was this translation helpful? Give feedback.
-
@Janglee123 Hi! Thank you for reporting this. Is the repository you’re trying to merge the pull request into public or private? |
Beta Was this translation helpful? Give feedback.
-
@jclem Thanks for your interest, The repo is public. |
Beta Was this translation helpful? Give feedback.
-
Ah, and I also just saw the accepted answer. We never send secrets to workflows run from the However, the “Run workflows from fork pull requests” only applies to private repositories—we have no plans to enable this setting for public repositories due to the potential for stealing secrets and accidentally granting any user write access to the public repository. Edit Just to be more explicit about why we don’t intend to support this for public repositories—since workflows on the |
Beta Was this translation helpful? Give feedback.
Assuming you mean your “first-bit” repo then you need to use
pull_request_target
as your on event (vs.pull_request
).For your checkout you want to make sure you checkout the PR content: