Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Auto-merge dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
damyan committed Oct 30, 2023
1 parent ad5d3f5 commit b5ac185
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Dependabot auto-approve
on: pull_request_target

permissions:
pull-requests: write
contents-requests: write

jobs:
dependabot:
runs-on: self-hosted
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1
- uses: actions/checkout@v4
- name: Approve a Dependabot PR
run: gh pr review --aprove "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit b5ac185

Please sign in to comment.