Skip to content

Commit

Permalink
ci: enable auto-merge for Dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
loozhengyuan committed Sep 29, 2024
1 parent cfdc22a commit de4a8c9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deps-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: deps-automerge

on:
pull_request:
branches:
- main

permissions:
contents: write
pull-requests: write

defaults:
run:
# NOTE: Default option does not include `-o pipefail` as documented
# unless explicitly specifying the `bash` shell.
# https://github.com/actions/runner/issues/353
shell: bash

jobs:
automerge:
runs-on: ubuntu-22.04
timeout-minutes: 2
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' && github.repository_owner == 'loozhengyuan' }}

steps:
- name: Fetch Dependabot metadata
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Enable auto-merge for Dependabot PRs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
gh pr merge --auto --squash --delete-branch "${PR_URL}"

0 comments on commit de4a8c9

Please sign in to comment.