Skip to content

Commit b89034c

Browse files
authored
ci: weekly auto-merge of Dependabot PRs (#59)
1 parent d303a62 commit b89034c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Weekly auto-merge Dependabot PRs
2+
on:
3+
schedule:
4+
- cron: '0 6 * * 1'
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
automerge:
11+
runs-on: ubuntu-latest
12+
env:
13+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v5
16+
- name: Merge clean Dependabot PRs
17+
run: |
18+
set -euo pipefail
19+
prs=$(gh pr list --state open --search 'author:app/dependabot' --json number,mergeStateStatus -L 200 \
20+
| jq -r '.[] | select(.mergeStateStatus=="CLEAN") | .number')
21+
for n in $prs; do
22+
echo "Enabling auto-merge for #$n"
23+
gh pr merge "$n" --squash --auto --delete-branch || true
24+
done

0 commit comments

Comments
 (0)