Skip to content

Commit 7fd80ec

Browse files
committed
Move dependenbot auto-merge within the main workflow
This ensures auto-approve and auto-merge for dependabot only occurs when CI passes.
1 parent 159c188 commit 7fd80ec

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

.github/workflows/dependabot-auto-merge.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,22 @@ jobs:
101101
env:
102102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103103
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
104+
105+
dependabot:
106+
runs-on: ubuntu-latest
107+
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'codama-idl/codama'
108+
needs: [lint, tests]
109+
permissions:
110+
contents: write
111+
pull-requests: write
112+
steps:
113+
- name: Auto-approve the PR
114+
run: gh pr review --approve "$PR_URL"
115+
env:
116+
PR_URL: ${{ github.event.pull_request.html_url }}
117+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
- name: Enable auto-merge
119+
run: gh pr merge --auto --squash "$PR_URL"
120+
env:
121+
PR_URL: ${{ github.event.pull_request.html_url }}
122+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)