Skip to content

Fix: Add GH_TOKEN to traffic updater agent environment#28

Merged
DanWahlin merged 1 commit intomainfrom
fix/traffic-updater-gh-token
Mar 31, 2026
Merged

Fix: Add GH_TOKEN to traffic updater agent environment#28
DanWahlin merged 1 commit intomainfrom
fix/traffic-updater-gh-token

Conversation

@DanWahlin
Copy link
Copy Markdown
Collaborator

The gh CLI inside the agentic workflow sandbox needs GH_TOKEN to call the Traffic API. This adds:

  1. GH_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} to the agent step's env block in the lock file
  2. A comment in traffic-updater.md reminding to re-add this after recompiles (since engine.env isn't supported by the compiler yet)

Note: Once gh aw supports engine.env, we can move this to the frontmatter and remove the manual step.

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>
Copilot AI review requested due to automatic review settings March 31, 2026 21:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md to re-add GH_TOKEN to the lockfile until engine.env is supported.
  • Added GH_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} to the “Execute GitHub Copilot CLI” (agent) step env in traffic-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.

@DanWahlin DanWahlin merged commit 8aa9557 into main Mar 31, 2026
7 checks passed
@DanWahlin DanWahlin deleted the fix/traffic-updater-gh-token branch March 31, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants