Skip to content

Commit

Permalink
Split auto-merge job into its own action
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLongstaff committed Sep 10, 2024
1 parent 8d52d56 commit 1ed88be
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Dependabot Auto Merge
#
# This Action will automatically merge Pull Requests created by Dependabot.
name: 'Dependency review'
on:
pull_request:
branches: [ "main" ]

permissions:
contents: write
pull-requests: write

jobs:
dependency-auto-merge:
name: 'Auto merge Dependabot updates'
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
use-github-auto-merge: true

20 changes: 0 additions & 20 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,3 @@ jobs:
# deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later
# retry-on-snapshot-warnings: true

dependency-auto-merge:
name: 'Auto merge (Dependabot PR)'
runs-on: ubuntu-latest
needs: [dependency-submission, dependency-review]
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}

steps:
- name: Fetch metadata
id: metadata
uses: dependabot/[email protected]
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

- name: Enable auto-merge
id: auto-merge
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1ed88be

Please sign in to comment.