Skip to content

Commit 62e4d71

Browse files
authored
ci: fix release-please permissions (#70)
This grants the release-please workflow the correct permissions (hopefully) for executing the publish docs / packages steps. More critically, it sets the `target-branch` on the `release-please` action, which is necessary for the workflow to succeed when run from a workflow_dispatch call.
1 parent 72481e3 commit 62e4d71

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/release-please.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ on:
66
branches:
77
- main
88

9+
910
jobs:
1011
rockspec-info:
1112
uses: ./.github/workflows/rockspec-info.yml
1213

1314
release-please:
1415
runs-on: ubuntu-latest
15-
1616
permissions:
17-
contents: write # Contents and pull-requests are for release-please to make releases.
18-
pull-requests: write
17+
pull-requests: write # Needed to create the release PR
18+
contents: write # Needed to generate the release
1919

2020
outputs:
2121
release_created: ${{ steps.release.outputs.release_created }}
@@ -26,6 +26,7 @@ jobs:
2626
id: release
2727
with:
2828
token: ${{ secrets.GITHUB_TOKEN }}
29+
target-branch: ${{ github.ref_name }}
2930

3031
update-release-pr:
3132
needs: release-please
@@ -46,6 +47,8 @@ jobs:
4647
branch: ${{ needs.release-please.outputs.pr_branch_name }}
4748

4849
publish-docs:
50+
permissions:
51+
contents: write # Needed to publish to Github Pages
4952
needs: release-please
5053
if: ${{ needs.release-please.outputs.release_created == 'true' }}
5154
runs-on: ubuntu-latest
@@ -60,6 +63,9 @@ jobs:
6063
token: ${{ secrets.GITHUB_TOKEN }}
6164

6265
publish-server:
66+
permissions: # Needed for access to the LuaRocks token
67+
id-token: write
68+
contents: read
6369
needs: [release-please, rockspec-info]
6470
if: ${{ needs.release-please.outputs.release_created == 'true' }}
6571
runs-on: ubuntu-latest
@@ -77,6 +83,9 @@ jobs:
7783
rockspec: ${{ fromJSON(needs.rockspec-info.outputs.info).server }}
7884

7985
publish-redis:
86+
permissions: # Needed for access to the LuaRocks token
87+
id-token: write
88+
contents: read
8089
needs: [ publish-server, rockspec-info ]
8190
runs-on: ubuntu-latest
8291
steps:

0 commit comments

Comments
 (0)