Add github-token support to all safe-output handlers with comprehensive test coverage#14819
Add github-token support to all safe-output handlers with comprehensive test coverage#14819
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
@copilot also support safe-outputs level github token: |
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
pelikhan
left a comment
There was a problem hiding this comment.
On a second thought, this is not correct in the new unified javascript handler since they all use the same token aside from agent task and project.
- Test safe-outputs level token with handlers - Test handler-level overriding safe-outputs level - Test all three levels (handler > safe-outputs > top-level) - Test project handlers with safe-outputs token - Test example from issue (safe-outputs + handler tokens) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
... Added comprehensive test coverage in commit 76373d2. The safe-outputs level github-token was already supported in the code and schema - I've added tests for all scenarios: ✅ Safe-outputs level token (already worked) Token precedence: handler-level > safe-outputs-level > top-level All tests pass:
|
…UB_TOKEN Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🔍 PR Triage ResultsCategory: bug | Risk: high | Priority: 73/100 Scores Breakdown
📋 Recommended Action: fast_trackRationale: This is a high-priority bug fix that resolves schema validation errors preventing users from configuring per-handler GitHub tokens. The changes span schemas, compiler logic, and documentation, requiring thorough review. The systematic approach (updating 17 handler schemas) and test coverage support fast-track review. Next Steps:
Triaged by PR Triage Agent on 2026-02-10T18:33:07Z
|
|
not making this change currently. |
Safe-outputs configurations with per-handler github-token values failed schema validation. Only 4 of 21 handlers supported the field despite all having
BaseSafeOutputConfig.GitHubToken.Changes
github-tokenproperty to 17 handler schemas (add-comment, create-issue, close-issue, update-issue, etc.)GH_AW_SAFE_OUTPUTS_HANDLER_CONFIGJSONTestHandlerManagerMultipleNonProjectTokens- Multiple handler-level tokensTestGitHubTokenPrecedenceAllLevels- All precedence combinations (5 scenarios)TestSafeOutputsLevelGitHubToken- Safe-outputs level token with handler overridesToken Precedence
The system now supports github-token at three levels with proper precedence:
Example Usage
Safe-outputs level token with handler overrides:
All three levels:
Behavior
All handlers now accept github-token in frontmatter. Individual tokens are preserved in handler config JSON. The github-script step uses the highest-priority token (project handlers > safe-outputs level > top-level) for Octokit authentication.
Enables workflows to use different tokens for different permissions scopes (e.g., standard token for issues, PAT for Projects v2).
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.