Conversation
pelikhan
reviewed
Feb 13, 2026
|
|
||
| // getActionRef returns the action reference string based on action mode and version | ||
| func getActionRef(actionMode workflow.ActionMode, version string) string { | ||
| if actionMode.IsRelease() && version != "" && version != "dev" { |
Contributor
There was a problem hiding this comment.
Dev contains "dirty" sometimes
Contributor
Author
There was a problem hiding this comment.
This is just factoring out code
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies and standardizes the repository checkout logic in the workflow compiler and extracts common action reference generation logic into a reusable helper function.
Changes:
- Simplified checkout step logic to always add checkout unless it's already in custom steps (removed complex conditional logic based on action mode and agent files)
- Extracted common action reference generation pattern into
getActionRef()helper function - Updated all related tests to reflect the new simplified checkout behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_jobs.go | Simplified shouldAddCheckoutStep() to always return true unless custom steps contain checkout, removed complex conditional logic for action modes and agent files |
| pkg/cli/copilot_setup.go | Added getActionRef() helper function and refactored four locations to use it instead of duplicating the action reference logic |
| pkg/workflow/compiler_jobs_test.go | Updated test expectation for release mode without agent file to expect checkout (changed from false to true) |
| pkg/workflow/compiler_yaml_main_job_test.go | Updated test name and expectation to reflect that checkout is required in release mode without agent file |
| pkg/workflow/engine_agent_import_test.go | Updated test name, comment, and expectation to reflect that checkout is always added without agent |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Feb 13, 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.
Summary
Key Changes
getActionRef()function to centralize action reference generationshouldAddCheckoutStep()to always add checkout by default