-
Notifications
You must be signed in to change notification settings - Fork 17
refactor: use gh aw logs for token analysis workflows #1884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -14,6 +14,8 @@ permissions: | |||
| actions: read | ||||
| issues: read | ||||
| pull-requests: read | ||||
| imports: | ||||
| - uses: shared/mcp/gh-aw.md | ||||
| network: | ||||
| allowed: | ||||
| - github | ||||
|
|
@@ -23,11 +25,39 @@ tools: | |||
| bash: true | ||||
| safe-outputs: | ||||
| create-issue: | ||||
| title-prefix: "⚡ Claude Token Optimization" | ||||
| title-prefix: "\u26a1 Claude Token Optimization" | ||||
| labels: [claude-token-optimization] | ||||
| close-older-issues: true | ||||
| timeout-minutes: 10 | ||||
| strict: true | ||||
| steps: | ||||
| - name: Download recent Claude workflow logs | ||||
| env: | ||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
| run: | | ||||
| set -euo pipefail | ||||
| mkdir -p /tmp/gh-aw/token-audit | ||||
|
|
||||
| echo "\U0001F4E5 Downloading Claude workflow logs (last 7 days)..." | ||||
|
|
||||
| LOGS_EXIT=0 | ||||
| gh aw logs \ | ||||
| --engine claude \ | ||||
| --start-date -7d \ | ||||
| --json \ | ||||
| -c 50 \ | ||||
|
||||
| -c 50 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow imports
shared/mcp/gh-aw.md, which already setsGH_TOKENusing the GH_AW_* fallback chain, but this step overridesGH_TOKENtosecrets.GITHUB_TOKEN. If the repo relies on a higher-scope token (or runs on GHE with different requirements), this can breakgh aw logs. Consider using the same fallback expression here, or omitGH_TOKENso the component’s choice applies.