2023-03-28 01:11:36 +02:00
|
|
|
---
|
2023-04-18 13:35:40 +02:00
|
|
|
# yamllint disable rule:line-length
|
2023-03-28 01:11:36 +02:00
|
|
|
name: Dependabot auto-approval and auto-merge
|
|
|
|
"on": pull_request
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
dependabot:
|
|
|
|
runs-on: ubuntu-latest
|
2023-04-18 13:35:40 +02:00
|
|
|
# limit this to PRs opened by dependabot
|
|
|
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
2023-03-28 01:11:36 +02:00
|
|
|
steps:
|
|
|
|
- name: Dependabot metadata
|
|
|
|
id: metadata
|
2024-03-25 00:29:46 +01:00
|
|
|
uses: dependabot/fetch-metadata@v2
|
2023-03-28 01:11:36 +02:00
|
|
|
with:
|
|
|
|
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
alert-lookup: true
|
|
|
|
compat-lookup: true
|
2023-09-06 02:25:30 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-28 02:34:17 +02:00
|
|
|
- name: Enable auto-merge for Dependabot PRs
|
|
|
|
run: gh pr merge --auto --squash "$PR_URL"
|
2023-03-28 01:11:36 +02:00
|
|
|
env:
|
|
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
2023-06-28 02:34:17 +02:00
|
|
|
- name: Approve a PR if not already approved
|
|
|
|
run: scripts/dependabot_automerge_check.sh "$PR_URL"
|
2023-03-28 01:11:36 +02:00
|
|
|
env:
|
|
|
|
PR_URL: ${{github.event.pull_request.html_url}}
|
|
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|