Skip to content

[pre-commit.ci] pre-commit autoupdate #140

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #140

# GitHub action to automerge dependabot PRs. Only merges if tests pass due to branch protections in the repo.
name: automerge-dependabot-prs
on: pull_request
permissions:
contents: write
pull-requests: write
jobs:
dependabot-automerge:
runs-on: ubuntu-latest
# if actor is dependabot or pre-commit-ci[bot] then run
if: ${{ github.actor == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
steps:
# Checkout action is required for token to persist
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL" # Use Github CLI to merge automatically the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{ secrets.AUTOMERGE_TOKEN }}
- name: Auto approve dependabot PRs
if: ${{ github.actor == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
uses: hmarr/auto-approve-action@v3.1.0
with:
github-token: ${{ secrets.AUTOMERGE_TOKEN }}