|
20 | 20 | with: |
21 | 21 | egress-policy: audit |
22 | 22 |
|
23 | | - - uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0 |
| 23 | + # The org's release-please GitHub App rather than a personal token: the |
| 24 | + # token is minted per run and expires in an hour, and it belongs to the |
| 25 | + # org rather than to whoever created the PAT — a PAT dies with its |
| 26 | + # owner's access and takes every repo's releases with it. |
| 27 | + # |
| 28 | + # actions:write is the load-bearing permission. Tags pushed with the |
| 29 | + # default GITHUB_TOKEN deliberately do not trigger workflows, which |
| 30 | + # would leave every release tagged and unbuilt; the App can. |
| 31 | + # |
| 32 | + # continue-on-error keeps releases working where the App is not yet |
| 33 | + # installed or its key is not provisioned: the next step falls back to |
| 34 | + # the PAT and says so, because a silent fallback is how a repo ends up |
| 35 | + # believing it uses the App when it never has. |
| 36 | + - uses: actions/create-github-app-token@v2 |
| 37 | + id: app-token |
| 38 | + if: ${{ vars.RP_APP_ID != '' }} |
| 39 | + continue-on-error: true |
24 | 40 | with: |
| 41 | + app-id: ${{ vars.RP_APP_ID }} |
| 42 | + private-key: ${{ secrets.RP_APP_PRIVATE_KEY }} |
| 43 | + |
| 44 | + - name: Which credential |
| 45 | + run: | |
| 46 | + if [ -n "${{ steps.app-token.outputs.token }}" ]; then |
| 47 | + echo "release-please is using the org's release-please App" |
| 48 | + else |
| 49 | + echo "::warning::App token unavailable (RP_APP_ID/RP_APP_PRIVATE_KEY unset, or the App is not installed here) — falling back to the repo PAT" |
| 50 | + fi |
| 51 | +
|
| 52 | + - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 |
| 53 | + with: |
| 54 | + # Set this to match the repo: go | simple | terraform-module | node | … |
25 | 55 | release-type: terraform-module |
26 | | - token: ${{ secrets.RELEASE_PLEASE_PAT }} |
| 56 | + token: ${{ steps.app-token.outputs.token || secrets.RELEASE_PLEASE_PAT }} |
0 commit comments