Repository navigation
Stay on the base branch so create-pull-request can open the PR - #173
Merged
Merged
Conversation
"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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
"Create pull request" fails outright:
peter-evans/create-pull-request documents
baseas "Defaults to thebranch checked out in the workflow", and creates the head branch itself
from the
branchinput. It expects to run from the base branch with thechanges 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:
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
branchinput as italways intended to. Setting
baseexplicitly would silence the errorbut leave HEAD on the head branch, against the action's documented use.
This had not surfaced before because the ambiguous
git fetch template mainaborted the job four steps earlier, so the workflow has neveropened 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