[WIP] Fix failing GitHub Actions workflow test#13966
Merged
Conversation
- In release mode without an agent file, skip automatic checkout since actions are pinned to remote refs and don't require .github/actions - In dev/script mode or with uninitialized mode, add checkout for local .github and .actions access - Preserves existing behavior for agent file imports and custom steps Fixes failing test: TestCheckoutWithAgentFromImports/no_checkout_without_agent_and_permissions Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot stopped work on behalf of
pelikhan due to an error
February 5, 2026 17:44
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a failing test by updating the shouldAddCheckoutStep function to properly handle different action modes. Previously, the function always returned true, assuming checkout was always needed for accessing .github and .actions folders. However, in release mode, actions use remote SHA-pinned references instead of local paths, so checking out the repository is unnecessary when no agent file is specified.
Changes:
- Modified
shouldAddCheckoutStepto skip checkout in release mode when no agent file is specified - Added logic to distinguish between dev/script modes (which need checkout for local
.githuband.actionsaccess) and release mode (which uses remote action references) - Aligned behavior with the permissions logic in
compiler_activation_jobs.gowhich only addscontents: readin dev/script mode
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Smoke Test Results (Run 21722230812)PRs Reviewed:
Test Results:
Overall Status: ✅ PASS cc: @pelikhan
|
This was referenced Feb 5, 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.
Fix TestCheckoutWithAgentFromImports test failure
The test
TestCheckoutWithAgentFromImports/no_checkout_without_agent_and_permissionswas failing because theshouldAddCheckoutStepfunction inpkg/workflow/compiler_jobs.gounconditionally returnedtrue, assuming the agent job always needs checkout.Root Cause
The function commented that "Agent job always gets contents: read permission for .github and .actions access" and always returned true. However, in release mode (
ActionModeRelease), actions are pinned to remote references (e.g.,github/gh-aw/.github/actions/setup@sha) rather than local paths, so checking out the.github/actionsfolder is unnecessary.Solution
Updated
shouldAddCheckoutStepto:This change aligns with the logic in
compiler_activation_jobs.golines 37-46, which only addscontents: readpermission when in dev/script mode.Testing
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.