Fix: install gh-aw CLI before gh aw logs in copilot-token-audit and copilot-token-optimizer#31618
Closed
Copilot wants to merge 6 commits into
Closed
Fix: install gh-aw CLI before gh aw logs in copilot-token-audit and copilot-token-optimizer#31618Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…nd copilot-token-optimizer Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add explicit installation of gh-aw CLI in upstream workflows
Fix: install gh-aw CLI before gh aw logs in copilot-token-audit and copilot-token-optimizer
May 12, 2026
pelikhan
reviewed
May 12, 2026
Comment on lines
+52
to
+61
| - name: Install gh-aw CLI | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| if gh extension list | grep -q "github/gh-aw"; then | ||
| gh extension upgrade gh-aw || true | ||
| else | ||
| gh extension install github/gh-aw | ||
| fi | ||
| gh aw --version |
Collaborator
There was a problem hiding this comment.
- use github/gh-aw-actions/setup-cli instead.
Contributor
Author
There was a problem hiding this comment.
Switched to github/gh-aw-actions/setup-cli in both workflows (pinned to v0.74.0, the current latest). Done in commit 8b3c8cf → the latest push.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Collaborator
|
@copilot merge main and recompile |
Collaborator
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes workflows that invoke gh aw logs in early/user-defined steps by ensuring the gh-aw CLI/extension is installed before the first gh aw invocation.
Changes:
- Added an explicit “Install gh-aw CLI” step (using
github/gh-aw-actions/setup-cli@v0.74.0) beforegh aw logsincopilot-token-audit.mdandcopilot-token-optimizer.md. - Recompiled the corresponding
.lock.ymlworkflows to include the new step. - Also includes unrelated lockfile churn in
blog-auditor.lock.ymlandunbloat-docs.lock.yml(allowed-tools deduping).
Show a summary per file
| File | Description |
|---|---|
.github/workflows/copilot-token-optimizer.md |
Installs gh-aw CLI before downloading workflow logs via gh aw logs. |
.github/workflows/copilot-token-optimizer.lock.yml |
Recompiled lock to include the new install step (but includes resolution/pinning issues). |
.github/workflows/copilot-token-audit.md |
Installs gh-aw CLI before downloading workflow logs via gh aw logs. |
.github/workflows/copilot-token-audit.lock.yml |
Recompiled lock to include the new install step (but includes resolution/pinning issues). |
.github/workflows/unbloat-docs.lock.yml |
Unrelated regeneration/deduping in allowed-tools list. |
.github/workflows/blog-auditor.lock.yml |
Unrelated regeneration/deduping in allowed-tools list. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 4
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"7430388914ae348ed20b0daad7f86ab4a28806a4cf32176948c289c430a73203","strict":true,"agent_id":"copilot"} | ||
| # gh-aw-manifest: {"version":1,"secrets":["GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_ENDPOINT","GH_AW_OTEL_HEADERS","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"v6.2.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"docker/build-push-action","sha":"bcafcacb16a39f128d818304e6c9c0c18556b85f","version":"v7.1.0"},{"repo":"docker/setup-buildx-action","sha":"4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd","version":"v4.0.0"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.43"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} | ||
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"10fa8e67ee28f2e2aecc36516c5632092383a92aabe122ba4aeb894aeea5bd55","strict":true,"agent_id":"copilot"} | ||
| # gh-aw-manifest: {"version":1,"secrets":["GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_ENDPOINT","GH_AW_OTEL_HEADERS","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-go","sha":"4a3601121dd01d1626a1e23e37211e3254c1c06c","version":"v6.4.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/setup-python","sha":"a309ff8b426b58ec0e2a45f0f869d46889d02405","version":"v6.2.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"docker/build-push-action","sha":"bcafcacb16a39f128d818304e6c9c0c18556b85f","version":"v7.1.0"},{"repo":"docker/setup-buildx-action","sha":"4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd","version":"v4.0.0"},{"repo":"github/gh-aw-actions/setup-cli","sha":"v0.74.0","version":"v0.74.0"}],"resolution_failures":[{"repo":"github/gh-aw-actions/setup-cli","ref":"v0.74.0","error_type":"dynamic_resolution_failed"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.43"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} |
Comment on lines
+1
to
+2
| # gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"a62e25bcbd131263f0db28576af9a972cd8a4ec17af91407da4123d0938912b9","strict":true,"agent_id":"copilot"} | ||
| # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_ENDPOINT","GH_AW_OTEL_HEADERS","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup-cli","sha":"v0.74.0","version":"v0.74.0"}],"resolution_failures":[{"repo":"github/gh-aw-actions/setup-cli","ref":"v0.74.0","error_type":"dynamic_resolution_failed"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.25.43"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.43"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.6","digest":"sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.6@sha256:2bb8eef86006a4c5963c55616a9c51c32f27bfdecb023b8aa6f91f6718d9171c"},{"image":"ghcr.io/github/github-mcp-server:v1.0.3","digest":"sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.3@sha256:2ac27ef03461ef2b877031b838a7d1fd7f12b12d4ace7796d8cad91446d55959"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]} |
Comment on lines
892
to
901
| # Allowed tools (sorted): | ||
| # - Bash(awk) | ||
| # - Bash(cat /tmp/gh-aw/cache-memory/) | ||
| # - Bash(cat > /tmp/gh-aw/cache-memory/) | ||
| # - Bash(cat) | ||
| # - Bash(cat) | ||
| # - Bash(cd) | ||
| # - Bash(cp) | ||
| # - Bash(curl) | ||
| # - Bash(date) | ||
| # - Bash(date) | ||
| # - Bash(echo) | ||
| # - Bash(echo) |
Comment on lines
738
to
744
| - name: Execute Claude Code CLI | ||
| id: agentic_execution | ||
| # Allowed tools (sorted): | ||
| # - Bash(cat) | ||
| # - Bash(cat) | ||
| # - Bash(date) | ||
| # - Bash(date) | ||
| # - Bash(echo) | ||
| # - Bash(echo) | ||
| # - Bash(find * -maxdepth 1) |
…-install # Conflicts: # .github/workflows/blog-auditor.lock.yml # .github/workflows/unbloat-docs.lock.yml Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done. Merged main, recompiled both workflows — the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug Fix
What was the bug?
copilot-token-auditandcopilot-token-optimizercallgh aw logsin user-defined pre-steps but never install the extension first. The framework's own "Install gh-aw extension" step runs after user-defined steps in the compiled lock file, so downstream runners without the extension pre-installed hard-fail withunknown command "aw" for "gh"and fall through to the empty-data path.How did you fix it?
Added an explicit "Install gh-aw CLI" step immediately before each
gh aw logscall in both source.mdfiles using thegithub/gh-aw-actions/setup-cliaction (SHA-pinned). Both lock files were recompiled viagh aw compileafter merging the latest main.Files changed:
copilot-token-audit.md— install step added before "Download Copilot workflow logs"copilot-token-optimizer.md— install step added before "Download recent Copilot workflow logs"copilot-token-audit.lock.yml/copilot-token-optimizer.lock.yml— recompiled with SHA-pinned action reference.github/aw/actions-lock.json— updated with SHA forgithub/gh-aw-actions/setup-cli@v0.74.0Audit of other workflows:
ab-testing-advisor.mdanddaily-cli-tools-tester.mdonly referencegh awin agent prompt text (not shell steps);daily-security-observability.mdalready had the install step.