Skip to content

Commit

Permalink
🔧 add auto merge github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Nismit committed May 9, 2024
1 parent 3d3b5b4 commit 1812b74
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dependabot auto-merge
on:
pull_request:
types:
- opened

permissions:
pull-requests: write
contents: write

jobs:
dependabot-automation:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
timeout-minutes: 10
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.4.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Approve & Auto Merge
if: |
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
(steps.metadata.outputs.update-type == 'version-update:semver-minor'
&& steps.metadata.outputs.dependency-type == 'direct:development')
run: |
gh pr review --approve "$PR_URL"
gh pr edit "$PR_URL" -t "(auto merged) $PR_TITLE"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
PR_TITLE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 1812b74

Please sign in to comment.