docs: fix GH_AW_AGENT_TOKEN fallback behavior documentation#14936
docs: fix GH_AW_AGENT_TOKEN fallback behavior documentation#14936mnkiefer merged 2 commits intorefactor-tokens-pagefrom
Conversation
Fix inconsistency in token precedence documentation by: - Adding clear "Token precedence and fallback" section explaining GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN behavior - Removing contradictory "no further fallback" statement - Simplifying Technical Implementation note to reference main documentation Matches implementation in pkg/workflow/github_token.go:getEffectiveAgentGitHubToken Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the token reference docs to remove contradictory statements about GH_AW_AGENT_TOKEN fallback behavior and align the documentation with the actual runtime token resolution logic used by gh-aw.
Changes:
- Added an explicit “Token precedence and fallback” section under
GH_AW_AGENT_TOKENand removed the prior “no further fallback” claim. - Simplified the “Technical Implementation” note to reference the main precedence/fallback section instead of repeating details.
- Updated the pinned commit for
docker/build-push-actionin the release workflow lockfile and added a corresponding entry to the actions lock JSON.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/src/content/docs/reference/tokens.md | Clarifies GH_AW_AGENT_TOKEN fallback behavior and removes contradictory wording. |
| .github/workflows/release.lock.yml | Updates the pinned SHA for docker/build-push-action used by the release workflow. |
| .github/aw/actions-lock.json | Adds a lock entry for docker/build-push-action@v6 to match the updated pin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - If `GH_AW_AGENT_TOKEN` is set, it is always used for agent assignment. | ||
| - If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution `GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN`. |
There was a problem hiding this comment.
The new bullets describe GH_AW_AGENT_TOKEN as "always used" when set, but runtime precedence in getEffectiveAgentGitHubToken uses a custom/per-output token and top-level github-token before checking GH_AW_AGENT_TOKEN. This section should reflect the full precedence (custom/per-output → workflow-level → GH_AW_AGENT_TOKEN → GH_AW_GITHUB_TOKEN → GITHUB_TOKEN) or reword to avoid implying env var wins over explicitly configured tokens.
| - If `GH_AW_AGENT_TOKEN` is set, it is always used for agent assignment. | |
| - If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution `GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN`. | |
| - For agent assignment, `gh-aw` first uses any token explicitly configured for the safe output (for example, a custom/per-output token), then any workflow-level `github-token` input. | |
| - If neither of those is provided and `GH_AW_AGENT_TOKEN` is set, it is used next for agent assignment. | |
| - If `GH_AW_AGENT_TOKEN` is _not_ set, `gh-aw` falls back to `GH_AW_GITHUB_TOKEN`, and then to `GITHUB_TOKEN`, matching the runtime resolution: custom/per-output → workflow-level → `GH_AW_AGENT_TOKEN` → `GH_AW_GITHUB_TOKEN` → `GITHUB_TOKEN`. |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | ||
| - name: Build Docker image (validation only) | ||
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6 | ||
| uses: docker/build-push-action@ee4ca427a2f43b6a16632044ca514c076267da23 # v6 | ||
| with: |
There was a problem hiding this comment.
This PR is described as a documentation-only fix, but this change also updates the pinned docker/build-push-action commit in the release workflow lockfile. Please either mention this action bump in the PR description (so reviewers understand the extra change) or split it into a separate PR to keep the docs change focused.
The
GH_AW_AGENT_TOKENsection contained contradictory statements about token fallback behavior. One part claimed "no further fallback", while another described fallback toGH_AW_GITHUB_TOKEN/GITHUB_TOKEN. The implementation usesGH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN(seepkg/workflow/github_token.go:getEffectiveAgentGitHubToken).Changes
The documentation now accurately reflects the runtime behavior:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.