Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: CI
permissions:
contents: read
issues: write

on:
push:
Expand All @@ -23,6 +22,8 @@ jobs:
id-token: write
actions: read
uses: ./.github/workflows/release.yaml
secrets:
VAULT_URL: ${{ secrets.VAULT_URL }}

notify-failure:
if: |
Expand Down
35 changes: 29 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: release

on:
workflow_call:
secrets:
VAULT_URL:
required: true

jobs:
release:
Expand All @@ -11,6 +14,29 @@ jobs:
id-token: write # Required for OIDC trusted publishing
runs-on: ubuntu-latest
steps:
- name: 'Retrieve Secrets from Vault'
id: vault
uses: hashicorp/vault-action@v3.4.0
with:
url: ${{ secrets.VAULT_URL }}
role: ${{ github.event.repository.name }}-github-action
method: jwt
path: github-actions
exportEnv: false
secrets: |
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN;

- name: Get Automation Bot User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/contentful-automation[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}

- name: Setting up Git User Credentials
run: |
git config --global user.name 'contentful-automation[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+contentful-automation[bot]@users.noreply.github.com'

- name: Checkout code
uses: actions/checkout@v5
with:
Expand All @@ -36,10 +62,7 @@ jobs:
dist
key: build-cache-${{ github.run_id }}-${{ github.run_attempt }}

- name: Setup Chrome
uses: browser-actions/setup-chrome@v2
with:
install-chromedriver: true

- name: Run semantic release
run: npm run semantic-release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading