Skip to content

Commit ebe27f3

Browse files
committed
build(ci): trigger CI workflow on dependabot merge [DX-665]
1 parent 63ceca0 commit ebe27f3

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/dependabot-approve-and-request-merge.yaml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ jobs:
1111
runs-on: ubuntu-latest
1212
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == github.event.pull_request.head.repo.full_name
1313
steps:
14-
- uses: contentful/github-auto-merge@v2
14+
- uses: contentful/github-auto-merge@b995e4ecd10bed72105998808b1fe666d6b0892d # v2
15+
id: auto-merge
1516
with:
16-
VAULT_URL: ${{ secrets.VAULT_URL }}
17+
VAULT_URL: ${{ secrets.VAULT_URL }}
18+
19+
# After merge, explicitly trigger CI workflow.
20+
# The auto-merge action uses the auto-generated workflow token for the merge,
21+
# which by design doesn't trigger push-based workflows (prevents infinite loops).
22+
- name: 'Retrieve Secrets from Vault'
23+
id: vault
24+
uses: hashicorp/vault-action@4c06c5ccf5c0761b6029f56cfb1dcf5565918a3b # v3.4.0
25+
with:
26+
url: ${{ secrets.VAULT_URL }}
27+
role: ${{ github.event.repository.name }}-github-action
28+
method: jwt
29+
path: github-actions
30+
exportEnv: false
31+
secrets: |
32+
github/token/${{ github.event.repository.name }}-semantic-release token | GITHUB_TOKEN;
33+
34+
- name: Trigger CI workflow on master
35+
run: gh workflow run main.yaml --ref master
36+
env:
37+
GITHUB_TOKEN: ${{ steps.vault.outputs.GITHUB_TOKEN }}

.github/workflows/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ permissions:
33
contents: read
44

55
on:
6+
workflow_dispatch:
67
push:
78
branches: ['**']
89

0 commit comments

Comments
 (0)