Skip to content

🔀 Fix checkout to use base branch instead of github.sha - #17249

Merged
dsyme merged 4 commits into
mainfrom
bb
Feb 20, 2026
Merged

🔀 Fix checkout to use base branch instead of github.sha#17249
dsyme merged 4 commits into
mainfrom
bb

Conversation

@dsyme

@dsyme dsyme commented Feb 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace implicit github.sha checkout with explicit ref: ${{ github.ref_name }} across all workflow lock files to prevent spurious "workflow file changed" errors
  • Update compiler_safe_outputs_steps.go to resolve the checkout ref dynamically — preferring the create-pull-request base branch when set, falling back to github.ref_name
  • Add unit tests covering default ref, custom base branch, and release branch scenarios

Copilot AI review requested due to automatic review settings February 20, 2026 17:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical issue where workflow checkouts were implicitly using github.sha instead of the base branch, which could cause spurious "workflow file changed" errors when an older commit's workflow files differ from the current branch.

Changes:

  • Updated checkout logic in compiler_safe_outputs_steps.go to explicitly set ref parameter, preferring CreatePullRequests.BaseBranch when configured, otherwise defaulting to github.ref_name
  • Added comprehensive unit tests covering default ref, custom base branch, and release branch scenarios
  • Regenerated all 31 workflow lock files to include the explicit ref: ${{ github.ref_name }} parameter in checkout steps

Reviewed changes

Copilot reviewed 33 out of 33 changed files in this pull request and generated no comments.

File Description
pkg/workflow/compiler_safe_outputs_steps.go Added logic to determine checkout ref, prioritizing custom base-branch from create-pull-request config, with fallback to github.ref_name
pkg/workflow/compiler_safe_outputs_steps_test.go Added three test cases validating default ref behavior, custom base-branch, and release branch scenarios
.github/workflows/*.lock.yml (31 files) Regenerated workflow files with explicit ref: ${{ github.ref_name }} in checkout steps to prevent spurious workflow file changed errors

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dsyme
dsyme merged commit b392fc2 into main Feb 20, 2026
48 checks passed
@dsyme
dsyme deleted the bb branch February 20, 2026 19:57
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