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

Function resolveCheckoutTokenExpression

pkg/workflow/checkout_step_generator.go:692–706  ·  view source on GitHub ↗
(entry *resolvedCheckout, checkoutIndex int, defaultWhenEmpty bool)

Source from the content-addressed store, hash-verified

690}
691
692func resolveCheckoutTokenExpression(entry *resolvedCheckout, checkoutIndex int, defaultWhenEmpty bool) string {
693 token := entry.token
694 if entry.githubApp != nil {
695 // The token is minted in the agent job itself (same-job step reference).
696 //nolint:gosec // G101: False positive - this is a GitHub Actions expression template placeholder, not a hardcoded credential
697 token = fmt.Sprintf("${{ steps.checkout-app-token-%d.outputs.token }}", checkoutIndex)
698 if entry.githubApp.shouldIgnoreMissingKey() {
699 token = combineTokenExpressions(token, getEffectiveGitHubToken(entry.token))
700 }
701 }
702 if token == "" && defaultWhenEmpty {
703 token = getEffectiveGitHubToken("")
704 }
705 return token
706}

Callers 3

generateFetchStepLinesFunction · 0.85

Calls 3

combineTokenExpressionsFunction · 0.85
getEffectiveGitHubTokenFunction · 0.85

Tested by

no test coverage detected