Skip to content

Commit 94c4087

Browse files
lpcoxCopilotCopilot
authored
fix: install gh-aw CLI extension in workflow pre-steps (#24335)
* fix: install gh-aw CLI extension in workflow pre-steps Multiple workflows using `./gh-aw logs` and `./gh-aw compile` in frontmatter `steps:` were silently failing because the gh-aw binary is not available in the runner's sparse-checkout working directory. The `steps:` run before the Copilot CLI and AWF are installed, and the runner only has a sparse checkout of the actions/ folder — no gh-aw binary exists at `./gh-aw`. Fix: Add an 'Install gh-aw CLI' step before data download steps and change `./gh-aw` to `gh aw` (extension invocation) in all affected workflows: - copilot-token-usage-analyzer - claude-token-usage-analyzer - copilot-token-optimizer - claude-token-optimizer - daily-copilot-token-report - daily-integrity-analysis - daily-syntax-error-quality - portfolio-analyst - static-analysis-report Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update .github/workflows/daily-syntax-error-quality.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: recompile daily-syntax-error-quality lock file after bash tool glob update Recompile to match the updated bash tool pattern 'gh aw compile *' which was added via GitHub UI edit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 211dcda commit 94c4087

18 files changed

Lines changed: 334 additions & 180 deletions

.github/workflows/claude-token-optimizer.lock.yml

Lines changed: 26 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/claude-token-optimizer.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ network: defaults
4444
timeout-minutes: 30
4545

4646
steps:
47+
- name: Install gh-aw CLI
48+
env:
49+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
if gh extension list | grep -q "github/gh-aw"; then
52+
gh extension upgrade gh-aw || true
53+
else
54+
gh extension install github/gh-aw
55+
fi
56+
gh aw --version
4757
- name: Find and download artifacts from the most expensive Claude workflow
4858
env:
4959
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -52,7 +62,7 @@ steps:
5262
mkdir -p /tmp/token-optimizer-claude
5363
5464
echo "📥 Loading Claude workflow runs from last 24 hours..."
55-
./gh-aw logs \
65+
gh aw logs \
5666
--engine claude \
5767
--start-date -1d \
5868
--json \

.github/workflows/claude-token-usage-analyzer.lock.yml

Lines changed: 26 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/claude-token-usage-analyzer.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ network: defaults
3636
timeout-minutes: 30
3737

3838
steps:
39+
- name: Install gh-aw CLI
40+
env:
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
if gh extension list | grep -q "github/gh-aw"; then
44+
gh extension upgrade gh-aw || true
45+
else
46+
gh extension install github/gh-aw
47+
fi
48+
gh aw --version
3949
- name: Download Claude workflow runs (last 24h)
4050
env:
4151
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -44,7 +54,7 @@ steps:
4454
mkdir -p /tmp/token-analyzer-claude
4555
4656
echo "📥 Downloading Claude workflow runs from last 24 hours..."
47-
./gh-aw logs \
57+
gh aw logs \
4858
--engine claude \
4959
--start-date -1d \
5060
--json \

0 commit comments

Comments
 (0)