Skip to content

feat(token): add GitHub Actions OIDC identity token provider - #17

Merged
bonifaido merged 3 commits into
mainfrom
feat/github-actions-id-token
Sep 30, 2026
Merged

bonifaido merged 3 commits into
mainfrom
feat/github-actions-id-token

Conversation

@bonifaido

Copy link
Copy Markdown
Member

Adds pkg/token/githubactions, an IdentityTokenProvider that fetches ID tokens from the GitHub Actions runtime so workflows can use them with any exchange, e.g. Anthropic WIF via rfc7523. The audience is set at construction, the request URL and token default to the runner's env vars, and tokens are cached until shortly before they expire. README has a usage example.

Fetches ID tokens from the Actions runtime so workflows can use them
with any exchange, e.g. Anthropic WIF via rfc7523. Tokens are cached
until shortly before they expire.

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.

Copilot review overview

🟡 Changes recommended

Network I/O under the mutex prevents waiting callers from honoring context cancellation, and documentation and error reporting need correction.

Review effort: Balanced
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

Adds a GitHub Actions OIDC identity-token provider for downstream credential exchanges.

Changes:

  • Fetches and caches runner-issued OIDC tokens.
  • Adds configurable audience, endpoint, bearer token, and HTTP client.
  • Adds tests and README usage guidance.
File Description
README.md Documents provider setup and usage.
pkg/​token/​githubactions/​option.go Defines provider configuration options.
pkg/​token/​githubactions/​githubactions.go Implements token retrieval and caching.
pkg/​token/​githubactions/​githubactions_test.go Tests requests, caching, errors, environment configuration, and RFC 7523 integration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/token/githubactions/githubactions.go Outdated
Comment thread README.md Outdated
Comment thread pkg/token/githubactions/githubactions.go Outdated
Let callers waiting on an in-flight fetch return when their context is
done, name the specific missing setting in the config error, and scope
the README claim to providers that take an identity token.
@bonifaido
bonifaido requested review from a team and a balanced review from Copilot September 30, 2026 12:20

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.

Copilot review overview

🟢 Approval recommended

The implementation is cohesive, tested, documented, and the previously identified issues are resolved.

Review effort: Balanced
Findings: None

Resolved since last review (3)

@bonifaido
bonifaido merged commit 226b46b into main Sep 30, 2026
2 checks passed
@bonifaido
bonifaido deleted the feat/github-actions-id-token branch September 30, 2026 12:48
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.

4 participants