Skip to content

fix(github): parse immutable OIDC sub claims#37831

Closed
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/oidc-immutable-sub-parse
Closed

fix(github): parse immutable OIDC sub claims#37831
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/oidc-immutable-sub-parse

Conversation

@H-TTTTT

@H-TTTTT H-TTTTT commented Jul 20, 2026

Copy link
Copy Markdown

Summary

  • Parse GitHub Actions OIDC sub claims with immutable @id suffixes (repo:owner@id/name@id:...) when exchanging installation tokens
  • Return JSON errors from failed installation lookups instead of uncaught Octokit failures
  • Harden client-side token exchange error handling so non-JSON responses and pre-auth failures do not crash on undefined octoRest (p.rest)

Fixes #37823

Test plan

  • bun test src/github-oidc.test.ts in packages/function
  • Reproduce on a repo created after 2026-07-15 with opencode github run (OIDC path, not use_github_token)
  • Confirm classic repo:owner/name:... subjects still exchange successfully

Strip @id suffixes from GitHub Actions immutable OIDC subject claims
when exchanging app tokens, and harden error handling so a failed
token exchange does not crash on an uninitialized Octokit client.

Fixes anomalyco#37823
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Jul 20, 2026
@github-actions github-actions Bot closed this Jul 20, 2026
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.

GitHub action fails on repos created after 2026-07-15 (new OIDC sub format)

1 participant