Skip to content

Weekly auto-merge Dependabot PRs #13

Weekly auto-merge Dependabot PRs

Weekly auto-merge Dependabot PRs #13

name: Weekly auto-merge Dependabot PRs
on:
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
automerge:
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v5
- name: Merge clean Dependabot PRs
run: |
set -euo pipefail
prs=$(gh pr list --state open --search 'author:app/dependabot' --json number,mergeStateStatus -L 200 \
| jq -r '.[] | select(.mergeStateStatus=="CLEAN") | .number')
for n in $prs; do
echo "Enabling auto-merge for #$n"
gh pr merge "$n" --squash --auto --delete-branch || true
done