MCPcopy Create free account
hub / github.com/github/gh-aw / getEffectiveCopilotCodingAgentGitHubToken

Function getEffectiveCopilotCodingAgentGitHubToken

pkg/workflow/github_token.go:90–97  ·  view source on GitHub ↗

getEffectiveCopilotCodingAgentGitHubToken returns the GitHub token to use for agent assignment operations, with precedence: 1. Custom token passed as parameter (e.g., from safe-outputs config github-token field) 2. secrets.GH_AW_AGENT_TOKEN (recommended token for agent assignment with elevated permi

(customToken string)

Source from the content-addressed store, hash-verified

88// Note: Assigning bots (like copilot-swe-agent) requires permissions that GITHUB_TOKEN may not have.
89// It's recommended to configure GH_AW_AGENT_TOKEN or GH_AW_GITHUB_TOKEN with appropriate permissions.
90func getEffectiveCopilotCodingAgentGitHubToken(customToken string) string {
91 if customToken != "" {
92 tokenLog.Print("Using custom agent GitHub token")
93 return customToken
94 }
95 tokenLog.Print("Using default agent GitHub token fallback chain (GH_AW_AGENT_TOKEN || GH_AW_GITHUB_TOKEN || GITHUB_TOKEN)")
96 return "${{ secrets.GH_AW_AGENT_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}"
97}
98
99// getEffectiveProjectGitHubToken returns the GitHub token to use for GitHub Projects v2 operations,
100// with precedence:

Calls 1

PrintMethod · 0.80

Tested by 1