Skip to content

Commit 6b1c1f7

Browse files
fix(ci): release github action needs correct github token permissions
1 parent 20bd74d commit 6b1c1f7

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.github/workflows/build.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,26 @@ permissions:
55

66
on:
77
workflow_call:
8+
VAULT_URL:
9+
required: true
810

911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
1214

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

.github/workflows/main.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
build:
1111
uses: ./.github/workflows/build.yaml
12+
secrets:
13+
VAULT_URL: ${{ secrets.VAULT_URL }}
1214

1315
check:
1416
needs: build

.github/workflows/release.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ jobs:
6262
dist
6363
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
6464

65+
- name: Setup Chrome
66+
uses: browser-actions/setup-chrome@v2
67+
with:
68+
install-chromedriver: true
69+
6570
- name: Run semantic release
6671
run: npm run semantic-release
6772
env:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"type": "module",
77
"exports": {
88
".": {
9+
"types": "./dist/types/index.d.ts",
910
"import": "./dist/esm/index.js",
10-
"require": "./dist/contentful.cjs",
11-
"types": "./dist/types/index.d.ts"
11+
"require": "./dist/contentful.cjs"
1212
}
1313
},
1414
"main": "./dist/esm/index.js",

0 commit comments

Comments
 (0)