Skip to content

Fix "Branch 'main' does not exist" error#24

Merged
jazzsequence merged 6 commits intomainfrom
21-main-branch-does-not-exist
Oct 30, 2025
Merged

Fix "Branch 'main' does not exist" error#24
jazzsequence merged 6 commits intomainfrom
21-main-branch-does-not-exist

Conversation

@jazzsequence
Copy link
Copy Markdown
Owner

@jazzsequence jazzsequence commented Oct 30, 2025

Update the workflow to support pull_request triggers by using GITHUB_BASE_REF if it's available.

fixes #21

The `git remote show origin` command can be unreliable for determining the default branch in some CI environments, particularly for pull requests from forks.

This change updates the validation script to prioritize the `GITHUB_BASE_REF` environment variable when it is available. This provides a more robust method for identifying the target branch within a GitHub Actions workflow.

Additionally, the script is modified to skip the branch checkout logic when running in a PR context, as the correct branch is already checked out by the workflow.
@jazzsequence jazzsequence merged commit 9cb142a into main Oct 30, 2025
4 checks passed
@jazzsequence jazzsequence deleted the 21-main-branch-does-not-exist branch October 30, 2025 21:30
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.

Error: Branch 'main' does not exist.

1 participant