Skip to content

Commit 1f6584a

Browse files
committed
build(ci): trigger CI workflow on dependabot merge [DX-665]
1 parent 43c92e9 commit 1f6584a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

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

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