Skip to content

Commit 8e5bac5

Browse files
authored
fix(ci): use RELEASE_PLZ_TOKEN in checkout action to trigger workflows (#132)
## Summary This PR fixes the release-plz workflow failure that occurred after PR #131 was merged. The previous approach of replacing `GITHUB_TOKEN` with `RELEASE_PLZ_TOKEN` in the env section caused the release-plz action to fail because its internal git-config step expects `GITHUB_TOKEN` to be set. ## Solution This fix uses a different approach: the `RELEASE_PLZ_TOKEN` is now used in the checkout action's `token` parameter. This allows: - The checkout to use the PAT (Personal Access Token) which can trigger other workflows - The release-plz action to still have access to `GITHUB_TOKEN` for its internal operations ## Changes - Added `token: ${{ secrets.RELEASE_PLZ_TOKEN }}` to both checkout steps in the release-plz workflow - Kept the original `GITHUB_TOKEN` in the env section unchanged This should properly trigger CI workflows on release-plz PRs while maintaining compatibility with the release-plz action. Fixes #130
1 parent 90f2fa4 commit 8e5bac5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/release-plz.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
fetch-depth: 0
26+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
2627
- name: Install Rust toolchain
2728
uses: dtolnay/rust-toolchain@stable
2829
- name: Run release-plz
2930
uses: release-plz/action@v0.5.110
3031
with:
3132
command: release
3233
env:
33-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3435
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3536

3637
# Create a PR with the new versions and changelog, preparing the next release.
@@ -49,12 +50,13 @@ jobs:
4950
uses: actions/checkout@v4
5051
with:
5152
fetch-depth: 0
53+
token: ${{ secrets.RELEASE_PLZ_TOKEN }}
5254
- name: Install Rust toolchain
5355
uses: dtolnay/rust-toolchain@stable
5456
- name: Run release-plz
5557
uses: release-plz/action@v0.5.110
5658
with:
5759
command: release-pr
5860
env:
59-
GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6062
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)