Skip to content

Commit

Permalink
Add dependabot auto-merge workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ittuann committed Oct 13, 2024
1 parent 96e5373 commit ef02ad0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dependabot auto-merge

on:
pull_request:
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
dependabot-auto-merge:
runs-on: ubuntu-latest

if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ittuann/Route2CIDR'

steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' || steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' }}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode

node_modules/
.eslintcache

Expand Down

0 comments on commit ef02ad0

Please sign in to comment.