fix: replace broken gh-aw install step in token audit workflow#24590
fix: replace broken gh-aw install step in token audit workflow#24590
Conversation
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>
There was a problem hiding this comment.
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-awand 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 |
There was a problem hiding this comment.
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.
| 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 |
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>
…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>
Problem
The compiler generates an
Install gh-aw extensionstep that usesgh extension list | grepto detect whether gh-aw is installed. When gh-aw was already installed viacurl | bash(fromcopilot-setup-steps.yml),gh extension listdoesn't detect it, so the step triesgh extension install github/gh-awwhich fails (directory already exists), andset -ekills the script before the binary copy for MCP containerization runs.Failed run: https://github.com/github/gh-aw/actions/runs/23987203365
Fix
shared/mcp/gh-aw.mdshared component with correct install logic:gh aw --versionto detect existing installs (works regardless of install method)curl | bashinstall (same ascopilot-setup-steps.yml)${RUNNER_TEMP}/gh-aw/gh-awfor MCP containerizationcopilot-token-audit.mdso the compiler skips its broken stepInstall gh-aw CLIstep (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.mdseparately.