Skip to content

fix: replace broken gh-aw install step in token audit workflow#24590

Merged
lpcox merged 1 commit intomainfrom
fix/token-audit-gh-aw-install
Apr 4, 2026
Merged

fix: replace broken gh-aw install step in token audit workflow#24590
lpcox merged 1 commit intomainfrom
fix/token-audit-gh-aw-install

Conversation

@lpcox
Copy link
Copy Markdown
Collaborator

@lpcox lpcox commented Apr 4, 2026

Problem

The compiler generates an Install gh-aw extension step that uses gh extension list | grep to detect whether gh-aw is installed. When gh-aw was already installed via curl | bash (from copilot-setup-steps.yml), gh extension list doesn't detect it, so the step tries gh extension install github/gh-aw which fails (directory already exists), and set -e kills the script before the binary copy for MCP containerization runs.

Failed run: https://github.com/github/gh-aw/actions/runs/23987203365

Fix

  • Create shared/mcp/gh-aw.md shared component with correct install logic:
    • Uses gh aw --version to detect existing installs (works regardless of install method)
    • Falls back to curl | bash install (same as copilot-setup-steps.yml)
    • Copies binary to ${RUNNER_TEMP}/gh-aw/gh-aw for MCP containerization
  • Import it in copilot-token-audit.md so the compiler skips its broken step
  • Remove redundant Install gh-aw CLI step (now handled by the shared component)

Scope

Only the token audit workflow is updated in this PR. Other affected workflows can adopt shared/mcp/gh-aw.md separately.

The compiler generates an 'Install gh-aw extension' step that uses
'gh extension list | grep' to detect the extension. This fails when
gh-aw was installed via curl (copilot-setup-steps.yml), causing the
step to try 'gh extension install' which also fails, and set -e kills
the script before the binary copy for MCP containerization runs.

Fix: create shared/mcp/gh-aw.md component that uses 'gh aw --version'
for detection and curl-based install as fallback. Import it in the
token audit workflow so the compiler skips its broken step.

Fixes run: https://github.com/github/gh-aw/actions/runs/23987203365

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 4, 2026 21:56
@lpcox lpcox merged commit d14a758 into main Apr 4, 2026
91 checks passed
@lpcox lpcox deleted the fix/token-audit-gh-aw-install branch April 4, 2026 21:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes failures in the Copilot token audit workflow caused by a brittle gh-aw install step by introducing a shared install component that detects existing installs via gh aw --version and ensures the gh-aw binary is copied into ${RUNNER_TEMP} for MCP containerization.

Changes:

  • Added a reusable workflow component to install/detect gh-aw and copy its binary to ${RUNNER_TEMP}/gh-aw/gh-aw.
  • Updated the token audit workflow to import the shared component and removed the redundant legacy install step.
  • Regenerated the compiled lock workflow to reflect the new import and step ordering.
Show a summary per file
File Description
.github/workflows/shared/mcp/gh-aw.md New shared component providing robust gh-aw detection/install and binary copy for MCP containerization.
.github/workflows/copilot-token-audit.md Imports the shared gh-aw installer component and removes the redundant install step.
.github/workflows/copilot-token-audit.lock.yml Compiled workflow updated to include the new shared import and replace the previous broken install logic.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

# Install gh-aw if not already available
if ! gh aw --version >/dev/null 2>&1; then
echo "Installing gh-aw extension..."
curl -fsSL https://raw.githubusercontent.com/github/gh-aw/refs/heads/main/install-gh-aw.sh | bash
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install command pulls install-gh-aw.sh from refs/heads/main, which makes the workflow non-deterministic (a change to the script on main can change behavior for older workflow revisions) and can also prevent PR changes to install-gh-aw.sh from being exercised in CI. Consider preferring the checked-out install-gh-aw.sh when present (or pinning the raw URL to a specific tag/commit) so the install logic matches the workflow revision being run.

Suggested change
curl -fsSL https://raw.githubusercontent.com/github/gh-aw/refs/heads/main/install-gh-aw.sh | bash
if [ -f ./install-gh-aw.sh ]; then
bash ./install-gh-aw.sh
else
curl -fsSL https://raw.githubusercontent.com/github/gh-aw/refs/heads/main/install-gh-aw.sh | bash
fi

Copilot uses AI. Check for mistakes.
lpcox added a commit that referenced this pull request Apr 4, 2026
Same fix as PR #24590 for the token audit workflow. The compiler
generates an 'Install gh-aw extension' step using 'gh extension list |
grep' which fails when gh-aw was installed via curl.

Fix: import shared/mcp/gh-aw.md which uses 'gh aw --version' for
detection and curl-based install as fallback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lpcox added a commit that referenced this pull request Apr 4, 2026
…24598)

Same fix as PR #24590 for the token audit workflow. The compiler
generates an 'Install gh-aw extension' step using 'gh extension list |
grep' which fails when gh-aw was installed via curl.

Fix: import shared/mcp/gh-aw.md which uses 'gh aw --version' for
detection and curl-based install as fallback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants