Fix compiler to preserve action version comments during deduplication #8011
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.
The workflow compiler was stripping version comments (e.g.,
# v6.1.0) from action uses during the deduplication process, causing three workflows to appear as if they had unpinned actions.Root Cause
The
DeduplicateRuntimeSetupStepsFromCustomStepsfunction inpkg/workflow/runtime_setup.gowas losing version comments during YAML processing because:#as a comment delimiteruses: action@sha # v6.1.0, the parser discarded# v6.1.0as a commentChanges Made
Updated
pkg/workflow/runtime_setup.go:unquoteUsesWithCommentsto handle YAML's automatic quoting of strings with#Affected workflows (now fixed):
.github/workflows/ci-coach.lock.yml.github/workflows/go-logger.lock.yml.github/workflows/hourly-ci-cleaner.lock.ymlResult
✅ All 5,715 external action uses across 126 workflows now have proper version comments
✅ 100% action pinning compliance achieved (5,715/5,715)
✅ All unit tests pass
✅ All workflows recompile successfully
The fix ensures version comments are preserved throughout the entire workflow compilation process, preventing this issue from occurring in future compilations.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.