Skip to content

Commit b1b34b3

Browse files
Copilotbug-ops
andcommitted
feat: Configure Trusted Publishing for crates.io
Replace manual CARGO_REGISTRY_TOKEN secret with OIDC-based Trusted Publishing. Changes: - Add permissions.id-token: write for OIDC token generation - Add permissions.contents: read for checkout access - Configure 'crates' environment with crates.io URL - Use rust-lang/crates-io-auth-action@v1 for authentication - Update CARGO_REGISTRY_TOKEN to use ephemeral token from auth action This matches the existing PyPI and npm Trusted Publishing configurations. Co-authored-by: bug-ops <[email protected]>
1 parent bd49de0 commit b1b34b3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,23 @@ jobs:
3232
runs-on: ubuntu-latest
3333
needs: crates-verify
3434
timeout-minutes: 15
35+
permissions:
36+
id-token: write
37+
contents: read
38+
environment:
39+
name: crates
40+
url: https://crates.io/crates/feedparser-rs
3541
steps:
3642
- uses: actions/checkout@v6
3743
- uses: dtolnay/rust-toolchain@stable
3844
- uses: Swatinem/rust-cache@v2
45+
- name: Authenticate with crates.io
46+
uses: rust-lang/crates-io-auth-action@v1
47+
id: auth
3948
- name: Publish to crates.io
4049
run: cargo publish -p feedparser-rs
4150
env:
42-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
51+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
4352

4453
# ============================================================================
4554
# PYPI

0 commit comments

Comments
 (0)