Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

Plan: Configure copilot agent to use COPILOT_GITHUB_TOKEN as GH_TOKEN

Problem: The gh agent-task create command in create_agent_session.cjs doesn't have access to the COPILOT_GITHUB_TOKEN because it's only set as the github-token parameter for actions/github-script, not as an environment variable for the gh CLI command.

Reference: https://github.com/githubnext/gh-aw/actions/runs/21112904976/job/60714164240#step:22:1

Changes completed:

  • Add GH_TOKEN and GITHUB_AW_AGENT_SESSION_BASE environment variables in the create-agent-session step (compiler_safe_outputs_specialized.go)
  • Update create_agent_session.cjs to read GH_TOKEN from environment and validate it
  • Pass GH_TOKEN to gh CLI command via env parameter in exec.getExecOutput
  • Build and compile test workflow successfully
  • Run unit tests - all passed
  • Recompile all workflows with changes
  • Run agent-finish to validate all changes (minor unrelated test failures in Docker/integration tests)
Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/21112904976/job/60714164240#step:22:1

Configure to run copilot agent using the same env as copilot COPILOT_GITHUB_TOKEN


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 18, 2026 14:13
…ironment variable

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add GH_TOKEN environment variable to create-agent-session step
- Update create_agent_session.cjs to read and pass GH_TOKEN to gh CLI
- Use Copilot token chain: COPILOT_GITHUB_TOKEN || GH_AW_GITHUB_TOKEN
- Ensures gh agent-task create command has proper authentication

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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