Skip to content

Commit f0c0f85

Browse files
ci: automerge pre-commit.ci PRs (#1553)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent c5d9177 commit f0c0f85

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/dependabot_automerge.yml renamed to .github/workflows/automerge_prs.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Dependabot auto-merge
1+
name: Automerge PRs (dependabot and pre-commit)
22
on: pull_request
33

44
permissions:
@@ -8,7 +8,6 @@ permissions:
88
jobs:
99
dependabot:
1010
runs-on: ubuntu-latest
11-
# Only run this workflow for branches starting with "dependabot/"
1211
if: startsWith(github.head_ref, 'dependabot/')
1312
steps:
1413
- name: Dependabot metadata
@@ -29,3 +28,25 @@ jobs:
2928
env:
3029
PR_URL: ${{github.event.pull_request.html_url}}
3130
GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
31+
32+
pre-commit:
33+
runs-on: ubuntu-latest
34+
if: startsWith(github.head_ref, 'pre-commit-ci-update-config')
35+
steps:
36+
- name: Assign PR to pyansys-ci-bot
37+
run: gh pr edit --assignee pyansys-ci-bot "$PR_URL"
38+
env:
39+
PR_URL: ${{github.event.pull_request.html_url}}
40+
GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
41+
42+
- name: Approve a PR
43+
run: gh pr review --approve "$PR_URL"
44+
env:
45+
PR_URL: ${{github.event.pull_request.html_url}}
46+
GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
47+
48+
- name: Enable auto-merge
49+
run: gh pr merge --auto --squash "$PR_URL"
50+
env:
51+
PR_URL: ${{github.event.pull_request.html_url}}
52+
GH_TOKEN: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
automerge pre-commit.ci PRs

0 commit comments

Comments
 (0)