Skip to content

Commit

Permalink
feat: auto-merge dependabot minor and patch PRs (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: tyler36 <[email protected]>
  • Loading branch information
tyler36 and tyler36 authored Feb 18, 2025
1 parent fd64a86 commit 45b1cb2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/dependabot-auto-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: chore

on: pull_request

permissions:
pull-requests: write
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# Require status checks to pass before merging for the target branch for Dependabot pull requests.
# This job should only be on projects with comprehensive testing.
dependabot:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == github.event.pull_request.head.repo.full_name
steps:

- name: "🤖 Dependabot metadata"
id: metadata
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: "🤖 Auto-merge Dependabot PRs for semver MINOR updates"
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: "🤖 Auto-merge Dependabot PRs for semver PATCH updates"
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 45b1cb2

Please sign in to comment.