Configure dependabot and associated workflows (#160)

The auto-merge workflow automatically approves dependabot PRs that
update dependencies or github actions where the semver difference is
at most a minor upgrade. These PRs are then auto-merged once the CI
checks have passed.

The labeller workflow adds / removes the auto-merge label to make
auto-merging more visible in issue lists and to make it possible to
filter such PRs. This workflow is unfortunately not triggered
when the auto-approve workflow enables auto-merging due to GH anti-
recursion rules, so the auto-merge workflow adds the label explicitly.
This commit is contained in:
Martijn Pieters
2023-05-16 14:06:11 +01:00
committed by GitHub
parent 23bb4e9cd4
commit 4236b350d9
3 changed files with 79 additions and 0 deletions

30
labeller.yaml Normal file
View File

@@ -0,0 +1,30 @@
name: Labeller
on:
pull_request_target:
types:
- auto_merge_disabled
- auto_merge_enabled
permissions: {}
jobs:
add_remove_labels:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Add auto-merge label
if: github.event.action == 'auto_merge_enabled'
run: gh pr edit "$PR_URL" --add-label "auto-merge"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Remove auto-merge label
if: github.event.action == 'auto_merge_disabled'
run: gh pr edit "$PR_URL" --remove-label "auto-merge"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}