Repository navigation
Ensure checkout step is always first when importing copilot-setup-steps.yml and remove redundant .github checkout - #13566
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
reviewed
Feb 3, 2026
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add checkout repository step to copilot-setup-steps
Ensure checkout step is always first when importing copilot-setup-steps.yml
Feb 3, 2026
pelikhan
marked this pull request as ready for review
February 3, 2026 19:43
Contributor
There was a problem hiding this comment.
Pull request overview
This PR ensures that repository checkout always occurs before other steps when importing copilot-setup-steps.yml, preventing failures when subsequent steps require repository access (e.g., Node.js cache, code builds).
Changes:
- Modified
extractStepsFromCopilotSetup()to guarantee checkout step is first by moving existing checkout or adding defaultactions/checkout@v4 - Added
ensureCheckoutStepFirst()helper function with pattern matching for checkout action detection - Added comprehensive test coverage for three scenarios: moving existing checkout, adding missing checkout, and no-op when already first
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/parser/yaml_import.go | Implements checkout step enforcement logic in step extraction |
| pkg/parser/yaml_import_copilot_setup_test.go | Adds test cases validating checkout step ordering behavior |
| .github/workflows/daily-copilot-token-report.lock.yml | Shows reordering of steps with checkout moved after gh-aw installation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot stopped work on behalf of
pelikhan due to an error
February 3, 2026 19:49
Collaborator
|
@copilot keep working |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
Ensure checkout step is always first when importing copilot-setup-steps.yml
Ensure checkout step is always first when importing copilot-setup-steps.yml and remove redundant .github checkout
Feb 3, 2026
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.
When
copilot-setup-steps.ymlis imported, steps requiring repository access (Node.js cache, code builds) ran before checkout, causing failures. Additionally, a redundant sparse.githubfolder checkout was present when a full repository checkout already existed.Changes
Modified
extractStepsFromCopilotSetup()to guarantee checkout step is first:actions/checkout@v4if missingAdded
ensureCheckoutStepFirst()helper with precise pattern matching:Fixed redundant .github checkout in
generateCheckoutGitHubFolder():.githubcheckout when custom steps contain full checkout.githubcheckout when automatic full checkout will be addedAdded 3 test cases covering: move existing, add missing, already first
Updated test expectations to verify
.githubcheckout is not present when redundantExample
Before (from
copilot-setup-steps.yml):After import:
Before (redundant checkout):
After (redundant checkout removed):
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.