Use COPILOT_GITHUB_TOKEN for Copilot task data collection in centralization optimizer#39437
Merged
Merged
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mnkiefer
June 15, 2026 19:07
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Copilot Centralization Optimizer workflow to authenticate the Copilot Agents API task-collection call with a Copilot-eligible user token (secrets.COPILOT_GITHUB_TOKEN) instead of github.token, resolving 401s during agent task data collection.
Changes:
- Switched
Collect agent task datato useGH_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}in the workflow source. - Recompiled the workflow so the generated
.lock.ymluses the same token and includesCOPILOT_GITHUB_TOKENin the manifest + log-redaction secret list.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/copilot-centralization-optimizer.md |
Updates the gh api /agents/... task-collection step to authenticate via secrets.COPILOT_GITHUB_TOKEN. |
.github/workflows/copilot-centralization-optimizer.lock.yml |
Propagates the auth change into the compiled workflow, and adds COPILOT_GITHUB_TOKEN to declared/redacted secrets. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
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 Copilot Centralization Optimizer workflow failed during task collection because it authenticated the Copilot Agents API with
github.token, which is not accepted by that endpoint. This change switches that step to a dedicated Copilot user token secret.Problem addressed
Collect agent task datacalledgh api /agents/repos/.../taskswithGH_TOKEN: ${{ github.token }}, causing 401s for endpoints that require a Copilot-eligible user token.Workflow auth update
copilot-centralization-optimizer.md, updated the step environment to use:GH_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}copilot-centralization-optimizer.lock.yml.Scope