Describe the bug
create_pull_request does not check out the correct branch when called from an action triggered by pull_request events, this means it runs on your main branch and attempts to PR any changes on main that aren't on your PR too.
The issue is that GITHUB_REF doesn't refer to the branch name on an action triggered via pull_request event it looks like: refs/pull/{pr_number}/merge.
|
git checkout "${GITHUB_REF#refs/heads/}" |
It should instead use ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}.

source
Describe the bug
create_pull_requestdoes not check out the correct branch when called from an action triggered bypull_requestevents, this means it runs on yourmainbranch and attempts to PR any changes onmainthat aren't on your PR too.The issue is that
GITHUB_REFdoesn't refer to the branch name on an action triggered viapull_requestevent it looks like:refs/pull/{pr_number}/merge.github-action/entrypoint.sh
Line 233 in 6ed209d
It should instead use
${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}.source