Skip to content

Commit 0254c69

Browse files
committed
Update.
1 parent 1896cea commit 0254c69

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

.github/workflows/automerge.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
name: Dependabot and Pre-commit auto-merge
2-
3-
on:
4-
pull_request:
1+
name: Auto-merge bot PRs
2+
on: pull_request
53

64
permissions:
75
contents: write
@@ -10,12 +8,18 @@ permissions:
108
jobs:
119
auto-merge:
1210
runs-on: ubuntu-latest
13-
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
11+
if: >
12+
github.repository == 'pytask-dev/pytask' &&
13+
(github.event.pull_request.user.login == 'dependabot[bot]' ||
14+
github.event.pull_request.user.login == 'pre-commit-ci[bot]')
1415
steps:
15-
- name: Enable auto-merge for Dependabot and pre-commit-ci PRs
16-
run: |
17-
gh pr review --approve "$PR_URL"
18-
gh pr merge --auto --merge "$PR_URL"
16+
- name: Approve PR
17+
run: gh pr review --approve "$PR_URL"
18+
env:
19+
PR_URL: ${{ github.event.pull_request.html_url }}
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Enable auto-merge
22+
run: gh pr merge --auto --merge "$PR_URL"
1923
env:
2024
PR_URL: ${{ github.event.pull_request.html_url }}
21-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)