Skip to content

Commit bba1bf8

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 bba1bf8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/release-plz.yml

Lines changed: 16 additions & 5 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,28 @@ 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 # 2.2.1
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
29-
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a
39+
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a # 0.5.120
3040
with:
3141
command: release
3242
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
3444
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3545

3646
# Create a PR with the new versions and changelog, preparing the next release.
3747
release-plz-pr:
3848
name: Release-plz PR
3949
runs-on: ubuntu-latest
50+
if: ${{ github.repository_owner == 'robinhundt' }}
4051
permissions:
4152
contents: write
4253
pull-requests: write
@@ -46,10 +57,10 @@ jobs:
4657
steps:
4758
- *checkout
4859
- *install-rust
60+
- *get-release-app-token
4961
- name: Run release-plz
50-
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a
62+
uses: release-plz/action@487eb7b5c085a664d5c5ca05f4159bd9b591182a # 0.5.120
5163
with:
5264
command: release-pr
5365
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
66+
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

0 commit comments

Comments
 (0)