Skip to content

Commit 98b1ed2

Browse files
committed
ci: use github app for release-pr
By using a GitHub App for creating the release PR, this enables the required status checks on the release PR to run. See: https://release-plz.dev/docs/github/token
1 parent ca2a7a0 commit 98b1ed2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/release-plz.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
release-plz-release:
1414
name: Release-plz release
1515
runs-on: ubuntu-latest
16+
if: ${{ github.repository_owner == 'robinhundt' }}
1617
permissions:
1718
contents: write
1819
steps:
@@ -25,18 +26,25 @@ jobs:
2526
- &install-rust
2627
name: Install Rust toolchain
2728
uses: dtolnay/rust-toolchain@stable
29+
- &get-release-app-token
30+
# Generating a GitHub token, so that PRs and tags created by
31+
# the release-plz-action can trigger actions workflows.
32+
name: Generate GitHub token
33+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
34+
id: generate-token
35+
with:
36+
app-id: ${{ secrets.RELEASE_APP_ID }}
37+
private-key: ${{ secrets.RELEASE_PRIVATE_KEY }}
2838
- name: Run release-plz
2939
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a
3040
with:
3141
command: release
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3542

3643
# Create a PR with the new versions and changelog, preparing the next release.
3744
release-plz-pr:
3845
name: Release-plz PR
3946
runs-on: ubuntu-latest
47+
if: ${{ github.repository_owner == 'robinhundt' }}
4048
permissions:
4149
contents: write
4250
pull-requests: write
@@ -46,10 +54,8 @@ jobs:
4654
steps:
4755
- *checkout
4856
- *install-rust
57+
- *get-release-app-token
4958
- name: Run release-plz
5059
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a
5160
with:
5261
command: release-pr
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)