Skip to content

Bug: gh aw upgrade wraps uses value in quotes, including the inline comment #19640

@srgibbs99

Description

@srgibbs99

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

  1. Have an existing copilot-setup-steps.yml in .github/workflows/.
  2. Run gh aw upgrade.
  3. Observe the generated uses: field for the setup-cli step.

Actual Output

- name: Install gh-aw extension
  uses: "github/gh-aw/actions/setup-cli@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2"
  with:
    version: v0.53.2

Expected Output

- name: Install gh-aw extension
  uses: github/gh-aw/actions/setup-cli@bd9c0ca491e6334a2797ef56ad6ee89958d54ab9 # v0.53.2
  with:
    version: v0.53.2

Error

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.2

Possibly Related

Environment

  • OS: macOS
  • gh-aw version: v0.53.2
  • GitHub Actions runner: 2.332.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions