(entry *resolvedCheckout, checkoutIndex int, defaultWhenEmpty bool)
| 690 | } |
| 691 | |
| 692 | func 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 | } |
no test coverage detected