Skip to content

Conversation

@petetan
Copy link
Contributor

@petetan petetan commented Aug 12, 2025

This PR updates branch validation logic to support GitHub Actions environments where local branches may not exist after checkout. Changes include:

  • Add remote branch fallback when local branches are missing
  • Update validateBranches to check local, then origin/branch, then fetch
  • Add resolveBranchRef helper for consistent branch resolution
  • Update tests for new validation logic

This addresses errors where GitHub Actions fails with 'Branch does not exist' due to missing local refs after checkout.

- Add remote branch fallback when local branches don't exist
- Handle GitHub Actions checkout behavior that only fetches specific refs
- Update validateBranches to try local, then origin/branch, then fetch
- Add resolveBranchRef helper for consistent branch resolution
- Update tests to account for new multi-step validation logic

Fixes issue where GitHub Actions environments fail with 'Branch does not exist'
error due to missing local branch references after checkout@v4.
@petetan petetan merged commit 0519219 into main Aug 12, 2025
1 check passed
@petetan petetan deleted the feature/fix-branch-validation branch August 12, 2025 06:44
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.

2 participants