Skip to content

Commit bc96e85

Browse files
ci(publish): switch cargo publishing to trusted OIDC auth (#403)
* ci(publish): switch cargo publishing to trusted OIDC auth Replace long-lived KORA_CLI_REGISTRY_TOKEN API token with crates.io trusted publishing via GitHub Actions OIDC identity tokens. Adds id-token: write permission and removes CARGO_REGISTRY_TOKEN env vars from both publish steps. The operator must add a trusted publisher entry on crates.io for kora-lib and kora-cli pointing to this workflow before the next publish run. * Update .github/workflows/rust-publish.yml Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(ci): remove duplicate jobs key and scope id-token permission The Greptile suggestion was applied incorrectly, inserting a duplicate top-level jobs: key. YAML last-key-wins semantics caused the id-token: write permission block to be silently discarded, leaving cargo publish with no auth mechanism. Fix: remove the duplicate jobs/publish block and add the permissions block directly under the single publish job. Also update CLAUDE.md to remove the stale KORA_CLI_REGISTRY_TOKEN secret reference. --------- Co-authored-by: Jo D <dev-jodee@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 42a0057 commit bc96e85

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/rust-publish.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ jobs:
3030
publish:
3131
name: Publish Kora crates to crates.io
3232
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
id-token: write
3336
steps:
3437
- name: Guard main branch for release publish
3538
run: |
@@ -89,8 +92,6 @@ jobs:
8992
run: |
9093
echo "📦 Publishing kora-lib@${{ steps.version.outputs.version }} to crates.io..."
9194
cargo publish -p kora-lib --locked
92-
env:
93-
CARGO_REGISTRY_TOKEN: ${{ secrets.KORA_CLI_REGISTRY_TOKEN }}
9495
9596
- name: Wait for kora-lib to be available on crates.io
9697
if: ${{ github.event.inputs.publish-kora-lib == 'true' }}
@@ -103,8 +104,6 @@ jobs:
103104
run: |
104105
echo "📦 Publishing kora-cli@${{ steps.version.outputs.version }} to crates.io..."
105106
cargo publish -p kora-cli --locked
106-
env:
107-
CARGO_REGISTRY_TOKEN: ${{ secrets.KORA_CLI_REGISTRY_TOKEN }}
108107
109108
- name: Create GitHub Release
110109
if: ${{ github.event.inputs.create-github-release == 'true' }}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Kora uses synchronized versioning where all workspace crates share the same vers
278278
- Both crates published together in dependency order
279279

280280
**GitHub Secrets Required:**
281-
- `KORA_CLI_REGISTRY_TOKEN` - crates.io API token for publishing
281+
- None — publishing uses crates.io trusted publishing via GitHub Actions OIDC (no API token needed)
282282

283283
### Claude Skill: Full Release Automation
284284

0 commit comments

Comments
 (0)