-
Notifications
You must be signed in to change notification settings - Fork 276
Description
Bug: gh aw upgrade wraps uses value in quotes, including the inline comment
Repository: github/gh-aw
Command: gh aw upgrade
Version: v0.53.2
Summary
After running gh aw upgrade, the copilot-setup-steps.yml file (and potentially other generated workflow files) has the uses: field for the setup-cli action wrapped in double quotes that include the inline # vX.Y.Z comment. Because the value is quoted, YAML treats the comment as part of the string rather than as a comment, causing GitHub Actions to attempt to resolve the full string — including the # v0.53.2 suffix — as a git ref.
Steps to Reproduce
- Have an existing
copilot-setup-steps.ymlin.github/workflows/. - Run
gh aw upgrade. - Observe the generated
uses:field for thesetup-clistep.
Actual Output
- name: Install gh-aw extension
uses: "github/gh-aw/actions/setup-cli@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2"
with:
version: v0.53.2Expected Output
- name: Install gh-aw extension
uses: github/gh-aw/actions/setup-cli@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2
with:
version: v0.53.2Error
The workflow fails immediately with:
Error: Unable to resolve action `github/gh-aw@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2`,
unable to find version `bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2`
Root Cause
In YAML, wrapping a value in double quotes causes the entire string — including a trailing # comment — to be treated as the literal value. The uses: field must be unquoted so that YAML parses # v0.53.2 as a comment and GitHub Actions only sees the SHA as the ref.
Workaround
Remove the surrounding quotes manually:
uses: github/gh-aw/actions/setup-cli@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2Possibly Related
Environment
- OS: macOS
- gh-aw version: v0.53.2
- GitHub Actions runner: 2.332.0