Skip to content

Commit 6296b91

Browse files
fix(ci): release github action needs correct github token permissions
1 parent 1e1a5c7 commit 6296b91

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.contentful/vault-secrets.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ services:
33
github-action:
44
policies:
55
- dependabot
6-
circleci:
7-
policies:
86
- semantic-release-ecosystem
9-
- packages-read

.github/workflows/build.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@ name: Build
22

33
permissions:
44
contents: read
5+
id-token: write
56

67
on:
78
workflow_call:
9+
secrets:
10+
VAULT_URL:
11+
required: true
812

913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
1216

1317
steps:
18+
- name: 'Retrieve Secrets from Vault'
19+
id: vault
20+
uses: hashicorp/[email protected]
21+
with:
22+
url: ${{ secrets.VAULT_URL }}
23+
role: ${{ github.event.repository.name }}-github-action
24+
method: jwt
25+
path: github-actions
26+
exportEnv: false
27+
secrets: |
28+
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN;
29+
1430
- name: Checkout code
1531
uses: actions/checkout@v5
1632

.github/workflows/main.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ on:
88

99
jobs:
1010
build:
11+
permissions:
12+
contents: read
13+
id-token: write
1114
uses: ./.github/workflows/build.yaml
15+
secrets:
16+
VAULT_URL: ${{ secrets.VAULT_URL }}
1217

1318
check:
1419
needs: build

0 commit comments

Comments
 (0)