Skip to content

feat: make the record key optional for GitHub OIDC - #164

Merged
agoldis merged 5 commits into
mainfrom
agoldis/oidc-optional-key
Nov 15, 2026
Merged

agoldis merged 5 commits into
mainfrom
agoldis/oidc-optional-key

Conversation

@agoldis

@agoldis agoldis commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Owner: @agoldis
Linear: project P-ENG-132 (OIDC record keys for CI)

What

  • The key input was already required: false, and the action already passes --key to currents cache get/set only when it is set.
  • The project ID selects the organization whose trust policy is checked, so the CLI needs it for OIDC. The action read the project-id input but never gave it to the CLI in cache mode. It now sets CURRENTS_PROJECT_ID for cache get and cache set when the input is set; a CURRENTS_PROJECT_ID already in the job env is kept otherwise.
  • New oidc-audience input, passed to the CLI as CURRENTS_OIDC_AUDIENCE. The CLI default is currents:record-key; staging and on-prem use their own value.
  • action.yml and README: key is optional; project-id is required when the record key comes from OIDC.
  • README: new "Without a stored record key" section. A job with permissions: id-token: write and no key lets the CLI exchange the GitHub OIDC token. CURRENTS_OIDC_TOKEN passes a token yourself. A configured key always wins.

Not ready to merge

Draft until the @currents/cmd release with OIDC support is published (currents-reporter PR #511). The README says "TODO: version"; fill it in then. The CLI side of CURRENTS_PROJECT_ID for the OIDC exchange is not in that PR yet.

Checks

npm run lint, npm test (42 passed) and npm run package pass; dist/ is rebuilt.

🤖 Generated with Claude Code

https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE

The key input was already optional and is passed to `currents cache get/set`
only when set. Document that a job with `id-token: write` and no key lets the
CLI use GitHub OIDC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
@agoldis agoldis added the OIDC OIDC record keys for CI (P-ENG-132) label Nov 13, 2026
@baz-reviewer

baz-reviewer Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Enable keyless cache operations by allowing the Currents CLI to obtain short-lived record keys through GitHub or externally supplied OIDC tokens, while forwarding project and audience configuration through the environment. Secure configured keys from command-line logging, preserve environment fallbacks, update action inputs and documentation, and validate the credential handling with tests and a rebuilt distribution.

Topics

TopicDetails
OIDC Cache Flow Route cache get and set operations through withCredentials, passing CURRENTS_PROJECT_ID, CURRENTS_RECORD_KEY, and CURRENTS_OIDC_AUDIENCE via the child process environment so OIDC can resolve credentials without exposing keys in command arguments. Persist the project and audience state across the action lifecycle and mask explicitly configured keys.
Modified files (4)
  • dist/index.js
  • src/index.ts
  • src/post.ts
  • src/utils.ts
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the oidc-aud...November 15, 2026
noreply@anthropic.comchore(deps): bump undi...October 27, 2026
Other Other files
Modified files (1)
  • dist/post.js
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the oidc-aud...November 15, 2026
noreply@anthropic.comchore(deps): bump undi...October 27, 2026
Action Configuration Expose OIDC configuration in the action contract and explain GitHub permissions, externally supplied tokens, audience overrides, project requirements, credential precedence, and the distinction between cache and API modes.
Modified files (2)
  • README.md
  • action.yml
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the oidc-aud...November 15, 2026
dj@currents.devchore: harden the rele...October 28, 2026
Credential Tests Verify that credential environment construction sets supplied values and preserves existing job-level values when inputs are empty, protecting the fallback and precedence behavior introduced for OIDC support.
Modified files (1)
  • src/__tests__/utils.test.ts
Latest Contributors(2)
UserCommitDate
agoldis@gmail.comfeat: add the oidc-aud...November 15, 2026
slavic@currents.devfeat: allow template f...November 26, 2024

Merger   ✅ Ready to Merge

MERGE: the diff implements optional record keys for GitHub OIDC and CI checks passed; no discussions require further work.



Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

agoldis and others added 3 commits November 13, 2026 17:34
A record key from OIDC is issued for one project. The action read the
project-id input but never gave it to `currents cache get/set`, which read
only CURRENTS_PROJECT_ID. Set that variable for both commands.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
The key input was put on the command line, which @actions/exec prints before
it runs the command, and the key was never registered with core.setSecret. A
key an earlier step produced without add-mask showed up in the log. Register
the key in the main and post steps and pass it as CURRENTS_RECORD_KEY. The
post step reads the input instead of the key saved as step state.

The README no longer calls the key issued by OIDC project-scoped: the project
ID selects the organization whose trust policy is checked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
@agoldis

agoldis commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@baz review

The audience of the OIDC token is a fixed name, not the origin of the Currents
URL. Staging and on-prem Currents use their own value. The input is passed to
the CLI as CURRENTS_OIDC_AUDIENCE in the main and post steps.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011baD3hG81A9qbFYrSn1ysE
@agoldis
agoldis marked this pull request as ready for review November 15, 2026 21:47
@agoldis
agoldis merged commit 81f1f1c into main Nov 15, 2026
27 checks passed
@agoldis
agoldis deleted the agoldis/oidc-optional-key branch November 15, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

baz: ready to merge OIDC OIDC record keys for CI (P-ENG-132)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant