-
Notifications
You must be signed in to change notification settings - Fork 366
Token optimization: auto-triage-issues workflow #26247
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 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,7 +12,9 @@ rate-limit: | |||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||
| issues: read | ||||||||||||||||||||||||||||||||
| engine: copilot | ||||||||||||||||||||||||||||||||
| engine: | ||||||||||||||||||||||||||||||||
| id: copilot | ||||||||||||||||||||||||||||||||
| model: gpt-4.1-mini | ||||||||||||||||||||||||||||||||
| strict: true | ||||||||||||||||||||||||||||||||
| network: | ||||||||||||||||||||||||||||||||
| allowed: | ||||||||||||||||||||||||||||||||
|
|
@@ -28,6 +30,16 @@ tools: | |||||||||||||||||||||||||||||||
| min-integrity: approved | ||||||||||||||||||||||||||||||||
| bash: | ||||||||||||||||||||||||||||||||
| - "jq *" | ||||||||||||||||||||||||||||||||
| - "cat *" | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| pre-agent: | ||||||||||||||||||||||||||||||||
| - name: Fetch unlabeled issues | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| mkdir -p /tmp/gh-aw/agent | ||||||||||||||||||||||||||||||||
| gh api "repos/github/gh-aw/issues?state=open&labels=&per_page=30" \ | ||||||||||||||||||||||||||||||||
| --jq '[.[] | select(.labels | length == 0) | {number: .number, title: .title, body: .body}]' \ | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| --jq '[.[] | select(.labels | length == 0) | {number: .number, title: .title, body: .body}]' \ | |
| --jq '[.[] | select((.pull_request | not) and (.labels | length == 0)) | {number: .number, title: .title, body: .body}]' \ |
Copilot
AI
Apr 14, 2026
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 frontmatter steps: block is using a nested pre-agent: key, but the compiler appears to treat steps: as the pre-agent step list already. This structure is producing a malformed compiled workflow (see auto-triage-issues.lock.yml where pre-agent: ends up inside a GitHub Actions step). Convert this to the supported format (make steps: a plain array of step objects) and re-run gh aw compile so the generated lock file is valid.
| pre-agent: | |
| - name: Fetch unlabeled issues | |
| run: | | |
| mkdir -p /tmp/gh-aw/agent | |
| gh api "repos/github/gh-aw/issues?state=open&labels=&per_page=30" \ | |
| --jq '[.[] | select(.labels | length == 0) | {number: .number, title: .title, body: .body}]' \ | |
| > /tmp/gh-aw/agent/unlabeled-issues.json | |
| echo "Unlabeled issues: $(jq length /tmp/gh-aw/agent/unlabeled-issues.json)" | |
| - name: Fetch unlabeled issues | |
| run: | | |
| mkdir -p /tmp/gh-aw/agent | |
| gh api "repos/github/gh-aw/issues?state=open&labels=&per_page=30" \ | |
| --jq '[.[] | select(.labels | length == 0) | {number: .number, title: .title, body: .body}]' \ | |
| > /tmp/gh-aw/agent/unlabeled-issues.json | |
| echo "Unlabeled issues: $(jq length /tmp/gh-aw/agent/unlabeled-issues.json)" |
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 pre-agent fetch step does not set
GH_TOKEN/GITHUB_TOKEN. On github.com runners,configure_gh_for_ghe.shdoes not authenticategh, so thisgh api ...call is likely to run unauthenticated (or fail/rate-limit). Also, without an explicitGH_TOKENin the pre-agent step, the compiler’s DIFC proxy injection for integrity filtering won’t trigger even thoughmin-integrity: approvedis configured. Add the appropriate token env vars on this step (and preferably rely on$GITHUB_REPOSITORYrather than hard-codinggithub/gh-aw).