Conversation
Contributor
There was a problem hiding this comment.
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.goto explicitly set ref parameter, preferringCreatePullRequests.BaseBranchwhen configured, otherwise defaulting togithub.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.
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.
Summary
github.shacheckout with explicitref: ${{ github.ref_name }}across all workflow lock files to prevent spurious "workflow file changed" errorscompiler_safe_outputs_steps.goto resolve the checkout ref dynamically — preferring thecreate-pull-requestbase branch when set, falling back togithub.ref_name