Skip to content

Commit 1e1a5c7

Browse files
fix(ci): semantic-release (#2591)
1 parent 9e98404 commit 1e1a5c7

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/main.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: CI
22
permissions:
33
contents: read
4-
issues: write
54

65
on:
76
push:
@@ -23,6 +22,8 @@ jobs:
2322
id-token: write
2423
actions: read
2524
uses: ./.github/workflows/release.yaml
25+
secrets:
26+
VAULT_URL: ${{ secrets.VAULT_URL }}
2627

2728
notify-failure:
2829
if: |

.github/workflows/release.yaml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: release
22

33
on:
44
workflow_call:
5+
secrets:
6+
VAULT_URL:
7+
required: true
58

69
jobs:
710
release:
@@ -11,6 +14,29 @@ jobs:
1114
id-token: write # Required for OIDC trusted publishing
1215
runs-on: ubuntu-latest
1316
steps:
17+
- name: 'Retrieve Secrets from Vault'
18+
id: vault
19+
uses: hashicorp/vault-action@v3.4.0
20+
with:
21+
url: ${{ secrets.VAULT_URL }}
22+
role: ${{ github.event.repository.name }}-github-action
23+
method: jwt
24+
path: github-actions
25+
exportEnv: false
26+
secrets: |
27+
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN;
28+
29+
- name: Get Automation Bot User ID
30+
id: get-user-id
31+
run: echo "user-id=$(gh api "/users/contentful-automation[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
32+
env:
33+
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}
34+
35+
- name: Setting up Git User Credentials
36+
run: |
37+
git config --global user.name 'contentful-automation[bot]'
38+
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+contentful-automation[bot]@users.noreply.github.com'
39+
1440
- name: Checkout code
1541
uses: actions/checkout@v5
1642
with:
@@ -36,10 +62,7 @@ jobs:
3662
dist
3763
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}
3864

39-
- name: Setup Chrome
40-
uses: browser-actions/setup-chrome@v2
41-
with:
42-
install-chromedriver: true
43-
4465
- name: Run semantic release
45-
run: npm run semantic-release
66+
run: npm run semantic-release
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)