Skip to content

Commit 740a4d8

Browse files
authored
ci: automerge-precommit (#151)
1 parent 3f20044 commit 740a4d8

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed
Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: dependabot
1+
name: automerge
22
on:
33
pull_request:
44
branches: [main]
@@ -12,7 +12,7 @@ concurrency:
1212
jobs:
1313
dependabot:
1414
permissions:
15-
contents: write
15+
contents: read
1616
pull-requests: write
1717

1818
if: ${{ github.actor == 'dependabot[bot]' }}
@@ -28,8 +28,26 @@ jobs:
2828

2929
- name: automerge
3030
if: ${{ !contains(steps.metadata.outputs.update-type, 'major' ) }}
31-
run: gh pr merge --auto --squash "${PR_NUMBER}"
31+
run: gh pr merge "${PR_NUMBER}" --auto --squash
3232
env:
33+
GH_REPO: ${{ github.repository }}
34+
GH_TOKEN: ${{ github.token }}
3335
PR_NUMBER: ${{ github.event.pull_request.number }}
36+
37+
pre-commit-ci:
38+
permissions:
39+
contents: read
40+
pull-requests: write
41+
42+
if: ${{ github.actor == 'pre-commit-ci' }}
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: automerge
46+
run: |
47+
gh pr edit "${PR_NUMBER}" --title "ci: ${PR_TITLE}"
48+
gh pr merge "${PR_NUMBER}" --auto --squash
49+
env:
3450
GH_REPO: ${{ github.repository }}
3551
GH_TOKEN: ${{ github.token }}
52+
PR_NUMBER: ${{ github.event.pull_request.number }}
53+
PR_TITLE: ${{ github.event.pull_request.title }}

0 commit comments

Comments
 (0)