Skip to content

Commit 31bb2c5

Browse files
committed
ci use github app token and existing crates.io token for release-plz
1 parent 65ee412 commit 31bb2c5

1 file changed

Lines changed: 30 additions & 26 deletions

File tree

.github/workflows/release-plz.yml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,62 @@ on:
88
permissions:
99
contents: read
1010

11+
concurrency:
12+
group: release-plz-${{ github.ref }}
13+
cancel-in-progress: false
14+
1115
jobs:
1216
release-plz-release:
1317
name: Release-plz release
1418
runs-on: ubuntu-latest
19+
if: ${{ github.repository_owner == 'RAprogramm' }}
1520
timeout-minutes: 30
16-
environment: release
17-
permissions:
18-
contents: write
19-
id-token: write
2021
steps:
21-
- uses: actions/checkout@v6
22+
- name: Mint GitHub App token
23+
id: app_token
24+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
25+
with:
26+
app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
27+
private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
28+
- name: Checkout repository
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2230
with:
2331
fetch-depth: 0
24-
persist-credentials: false
32+
token: ${{ steps.app_token.outputs.token }}
2533
- name: Install stable Rust
26-
uses: dtolnay/rust-toolchain@stable
27-
- name: Authenticate to crates.io
28-
id: crates-auth
29-
uses: rust-lang/crates-io-auth-action@v1
34+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3035
- name: Run release-plz
31-
uses: release-plz/action@v0.5
36+
uses: release-plz/action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5
3237
with:
3338
command: release
3439
env:
35-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
CARGO_REGISTRY_TOKEN: ${{ steps.crates-auth.outputs.token }}
40+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
41+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
3742

3843
release-plz-pr:
3944
name: Release-plz PR
4045
runs-on: ubuntu-latest
46+
if: ${{ github.repository_owner == 'RAprogramm' }}
47+
needs: release-plz-release
4148
timeout-minutes: 30
42-
permissions:
43-
contents: read
44-
concurrency:
45-
group: release-plz-${{ github.ref }}
46-
cancel-in-progress: false
4749
steps:
48-
- name: Generate GitHub App token
49-
id: app-token
50-
uses: actions/create-github-app-token@v2
50+
- name: Mint GitHub App token
51+
id: app_token
52+
uses: actions/create-github-app-token@fee1f7d63c2ff003460e3d139729b119787bc349 # v2
5153
with:
5254
app-id: ${{ secrets.RELEASE_PLZ_APP_ID }}
5355
private-key: ${{ secrets.RELEASE_PLZ_APP_PRIVATE_KEY }}
54-
- uses: actions/checkout@v6
56+
- name: Checkout repository
57+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5558
with:
5659
fetch-depth: 0
57-
persist-credentials: false
60+
token: ${{ steps.app_token.outputs.token }}
5861
- name: Install stable Rust
59-
uses: dtolnay/rust-toolchain@stable
62+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
6063
- name: Run release-plz
61-
uses: release-plz/action@v0.5
64+
uses: release-plz/action@064f4d1e36c843611ddf013be726beaa4ad804db # v0.5
6265
with:
6366
command: release-pr
6467
env:
65-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
68+
GITHUB_TOKEN: ${{ steps.app_token.outputs.token }}
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

0 commit comments

Comments
 (0)