Fix: Add GH_TOKEN to traffic updater agent environment#28
Merged
Conversation
The gh CLI needs GH_TOKEN set in the agent sandbox to authenticate with the GitHub Traffic API. engine.env is not yet supported by the gh-aw compiler, so the lock file requires a manual addition after each recompile. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the GH_TOKEN environment variable to the Traffic Updater agent execution context so the gh CLI in the sandbox can authenticate to GitHub’s Traffic API, and documents the current compiler workaround.
Changes:
- Documented a post-compile manual step in
traffic-updater.mdto re-addGH_TOKENto the lockfile untilengine.envis supported. - Added
GH_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}to the “Execute GitHub Copilot CLI” (agent) step env intraffic-updater.lock.yml.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/traffic-updater.md | Adds a reminder comment about re-applying GH_TOKEN to the lockfile after gh aw compile. |
| .github/workflows/traffic-updater.lock.yml | Injects GH_TOKEN into the agent step environment so gh api .../traffic/views can authenticate. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
ghCLI inside the agentic workflow sandbox needsGH_TOKENto call the Traffic API. This adds:GH_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }}to the agent step's env block in the lock filetraffic-updater.mdreminding to re-add this after recompiles (sinceengine.envisn't supported by the compiler yet)Note: Once
gh awsupportsengine.env, we can move this to the frontmatter and remove the manual step.