Skip to content

Commit d27d1d9

Browse files
authored
fix: trusted publishing authentication (#30)
Signed-off-by: Wolf Vollprecht <[email protected]>
1 parent 58c8b11 commit d27d1d9

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.github/workflows/interop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
interop:
1515
name: Interoperability Tests
1616
runs-on: ubuntu-latest
17+
# Only run on push, workflow_dispatch, or PRs from the same repo (not forks)
18+
# Fork PRs don't have access to OIDC tokens needed for signing
19+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
1720
permissions:
1821
id-token: write # Required for OIDC token
1922
contents: read

.github/workflows/release-plz.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
concurrency:
1616
group: release-plz-release
1717
cancel-in-progress: false
18+
1819
# Permissions needed for:
1920
# - contents: write - create GitHub releases
2021
# - pull-requests: write - update PRs
@@ -23,12 +24,16 @@ jobs:
2324
contents: write
2425
pull-requests: write
2526
id-token: write
27+
2628
steps:
2729
- name: Checkout repository
2830
uses: actions/checkout@v6
2931
with:
3032
fetch-depth: 0
3133

34+
- uses: rust-lang/crates-io-auth-action@v1
35+
id: auth
36+
3237
- name: Install Rust toolchain
3338
uses: dtolnay/[email protected]
3439

@@ -38,8 +43,7 @@ jobs:
3843
command: release
3944
env:
4045
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
41-
# Uses trusted publishing via OIDC (id-token: write permission)
42-
# No CARGO_REGISTRY_TOKEN needed
46+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
4347

4448
# Create a PR with the new versions and changelog, preparing the next release.
4549
release-plz-pr:

0 commit comments

Comments
 (0)