Skip to content

Commit

Permalink
Fix/simplify dependabot PR auto-merge action
Browse files Browse the repository at this point in the history
  • Loading branch information
ylabonte committed Mar 14, 2024
1 parent 50009a7 commit 616cdfe
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: "Auto-Merge Dependabot PRs"

on:
workflow_run:
workflows:
- "CI Workflow"
types:
- completed
on: [ pull_request ]

permissions:
contents: write
Expand All @@ -14,19 +9,12 @@ permissions:
jobs:
automerge:
name: "Auto-merge Dependabot PR"
needs:
- analyze
- build
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: "Fetch Dependabot metadata"
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "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: "Auto-merge the PRs"
run: gh pr merge --auto --merge "$PR_URL"
env:
Expand Down

0 comments on commit 616cdfe

Please sign in to comment.