Skip to content

Commit

Permalink
Move dependenbot auto-merge within the main workflow
Browse files Browse the repository at this point in the history
This ensures auto-approve and auto-merge for dependabot only occurs when CI passes.
  • Loading branch information
lorisleiva committed Nov 27, 2024
1 parent 159c188 commit 7fd80ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/dependabot-auto-merge.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,22 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'codama-idl/codama'
needs: [lint, tests]
permissions:
contents: write
pull-requests: write
steps:
- name: Auto-approve the PR
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7fd80ec

Please sign in to comment.