Skip to content

Stay on the base branch so create-pull-request can open the PR - #173

Merged
Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/template-sync-pr-base
Oct 5, 2026
Merged

Bill Traynor (wmat) merged 1 commit into
mainfrom
fix/template-sync-pr-base

Conversation

@wmat

Copy link
Copy Markdown
Collaborator

"Create pull request" fails outright:

The 'base' and 'branch' for a pull request must be different
branches. Unable to continue.

peter-evans/create-pull-request documents base as "Defaults to the
branch checked out in the workflow", and creates the head branch itself
from the branch input. It expects to run from the base branch with the
changes sitting in the working tree.

"Create branch" breaks that contract by switching HEAD to the very
branch the action is then told to create. From the runner log:

Checkout repository  git checkout --force -B main refs/remotes/origin/main
                     Switched to a new branch 'main'
Create branch        git switch -c gitbot/template-sync-b3ee316
Create pull request  base := gitbot/template-sync-b3ee316
                     branch := gitbot/template-sync-b3ee316  -> refused

So base and branch are necessarily equal and the step can never succeed.
Drop the step: checkout already leaves HEAD on the default branch, the
copy and .template-version steps stage into that working tree, and the
action creates gitbot/template-sync- from the branch input as it
always intended to. Setting base explicitly would silence the error
but leave HEAD on the head branch, against the action's documented use.

This had not surfaced before because the ambiguous git fetch template main aborted the job four steps earlier, so the workflow has never
opened a pull request in any repository. Observed on
riscv/riscv-high-assurance-cryptography actions run 37329553648, the
first run to reach this step.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Signed-off-by: Bill Traynor wmat@riscv.org

"Create pull request" fails outright:

    The 'base' and 'branch' for a pull request must be different
    branches. Unable to continue.

peter-evans/create-pull-request documents `base` as "Defaults to the
branch checked out in the workflow", and creates the head branch itself
from the `branch` input. It expects to run from the base branch with the
changes sitting in the working tree.

"Create branch" breaks that contract by switching HEAD to the very
branch the action is then told to create. From the runner log:

    Checkout repository  git checkout --force -B main refs/remotes/origin/main
                         Switched to a new branch 'main'
    Create branch        git switch -c gitbot/template-sync-b3ee316
    Create pull request  base := gitbot/template-sync-b3ee316
                         branch := gitbot/template-sync-b3ee316  -> refused

So base and branch are necessarily equal and the step can never succeed.
Drop the step: checkout already leaves HEAD on the default branch, the
copy and .template-version steps stage into that working tree, and the
action creates gitbot/template-sync-<sha> from the `branch` input as it
always intended to. Setting `base` explicitly would silence the error
but leave HEAD on the head branch, against the action's documented use.

This had not surfaced before because the ambiguous `git fetch template
main` aborted the job four steps earlier, so the workflow has never
opened a pull request in any repository. Observed on
riscv/riscv-high-assurance-cryptography actions run 37329553648, the
first run to reach this step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Bill Traynor <wmat@riscv.org>
@wmat
Bill Traynor (wmat) merged commit a8d9b42 into main Oct 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant