Skip to content

Commit 1d20042

Browse files
authored
Enable automerge for pre-commit and dependabot. (#731)
1 parent 4fb2a64 commit 1d20042

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/workflows/automerge.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Dependabot and Pre-commit auto-merge
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
auto-merge:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
13+
steps:
14+
- name: Enable auto-merge for Dependabot and pre-commit-ci PRs
15+
run: |
16+
gh pr review --approve "$PR_URL"
17+
gh pr merge --auto --merge "$PR_URL"
18+
env:
19+
PR_URL: ${{ github.event.pull_request.html_url }}
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typing-nb:
2424

2525
# Run linting
2626
lint:
27-
uvx --with pre-commit-uv pre-commit run -a
27+
uvx prek run -a
2828

2929
# Run all checks (format, lint, typing, test)
3030
check: lint typing test

0 commit comments

Comments
 (0)