Skip to content

Enhanced debugging for OIDC token exchange#2443

Open
Lanaparezanin wants to merge 1 commit into
actions:mainfrom
Lanaparezanin:lpar-enhance-logs
Open

Enhanced debugging for OIDC token exchange#2443
Lanaparezanin wants to merge 1 commit into
actions:mainfrom
Lanaparezanin:lpar-enhance-logs

Conversation

@Lanaparezanin

Copy link
Copy Markdown

In NuGet, we want to change our OIDC implementation to use toolkit functions. I am enhancing these logs to support that transition.

@Lanaparezanin Lanaparezanin requested a review from a team as a code owner June 22, 2026 20:12
Copilot AI review requested due to automatic review settings June 22, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves diagnosability of the OIDC ID token exchange flow in @actions/core by enriching error messages and ensuring sensitive request tokens are masked in logs during failures.

Changes:

  • Expanded missing-OIDC-permissions error messages for ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL.
  • Added setSecret(token) for the OIDC request token to ensure it gets masked if it appears in logs.
  • Improved the “missing ID token in response” error message with HTTP status and actionable troubleshooting guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 31 to 35
throw new Error(
'Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'
'Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable. Ensure your workflow has:\n' +
' permissions:\n' +
' id-token: write'
)
Comment on lines 43 to +48
if (!runtimeUrl) {
throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable')
throw new Error(
'Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable. Ensure your workflow has:\n' +
' permissions:\n' +
' id-token: write'
)
Comment on lines +68 to +71
throw new Error(
`Response json body does not have ID Token field (HTTP ${res.statusCode}). ` +
'Verify that the audience is correct and that the token service URL is reachable.'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants