Skip to content

Commit 9b22b83

Browse files
authored
fix: give release integration workflow correct permissions and secrets (#384)
1 parent 3d76fc4 commit 9b22b83

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

.github/workflows/release-integration.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
required: true
1616
type: string
1717
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
18+
secrets:
19+
PUBLISH_TOKEN:
20+
required: true
1821

1922
jobs:
2023
publish:
@@ -24,7 +27,6 @@ jobs:
2427
run:
2528
shell: bash
2629
permissions:
27-
deployments: write
2830
id-token: write
2931
steps:
3032
- name: Checkout

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ jobs:
243243
name: Release Integration
244244
if: needs.release.outputs.releases
245245
uses: ./.github/workflows/release-integration.yml
246+
permissions:
247+
id-token: write
248+
secrets:
249+
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
246250
with:
247251
releases: ${{ needs.release.outputs.releases }}
248252

lib/content/_job-release-integration-yml.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ defaults:
55
shell: bash
66
{{#if publish}}
77
permissions:
8-
deployments: write
98
id-token: write
109
{{/if}}
1110
steps:

lib/content/release-integration-yml.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
required: true
1414
type: string
1515
description: 'A json array of releases. Required fields: publish: tagName, publishTag. publish check: pkgName, version'
16+
{{#if publish}}
17+
secrets:
18+
PUBLISH_TOKEN:
19+
required: true
20+
{{/if}}
1621

1722
jobs:
1823
publish:

lib/content/release-yml.hbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,12 @@ jobs:
184184
name: Release Integration
185185
if: needs.release.outputs.releases
186186
uses: ./.github/workflows/release-integration.yml
187+
{{#if publish}}
188+
permissions:
189+
id-token: write
190+
secrets:
191+
PUBLISH_TOKEN: $\{{ secrets.PUBLISH_TOKEN }}
192+
{{/if}}
187193
with:
188194
releases: $\{{ needs.release.outputs.releases }}
189195

0 commit comments

Comments
 (0)