Skip to content

Commit 15ddb46

Browse files
committed
Rework dependabot auto-merge mechanism/workflow
1 parent 15e206a commit 15ddb46

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
assignees:
8+
- ylabonte
9+
310
- package-ecosystem: "pip"
411
directory: "/"
512
schedule:

.github/workflows/automerge.yml

+10-16
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,25 @@ name: "Auto-Merge Dependabot PRs"
33
on:
44
pull_request:
55
branches:
6-
- master
6+
- "main"
77

88
permissions:
9-
actions: read
10-
security-events: write
119
contents: write
1210
pull-requests: write
1311

1412
jobs:
15-
lint:
16-
name: "Run CI Workflow"
17-
uses: ./.github/workflows/pylint.yml
18-
test:
19-
name: "Run CI Workflow"
20-
uses: ./.github/workflows/unittest.yml
2113
automerge:
22-
name: "Auto-merge PR (Dependabot only!)"
23-
needs:
24-
- lint
25-
- test
14+
name: "Auto-approve PR"
2615
runs-on: ubuntu-latest
27-
if: github.actor == 'dependabot[bot]'
16+
if: github.actor == 'dependabot[bot]' || github.actor == 'ylabonte'
2817
steps:
29-
- name: "Auto-merge the PRs"
30-
run: gh pr merge --auto --merge "$PR_URL"
18+
- name: "Approve PR to enable auto-merge"
19+
run: gh pr review --approve "$PR_URL"
20+
env:
21+
PR_URL: ${{github.event.pull_request.html_url}}
22+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
23+
- name: "Auto-merge PR"
24+
run: gh pr merge --merge --auto "$PR_URL"
3125
env:
3226
PR_URL: ${{github.event.pull_request.html_url}}
3327
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/pylint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Lint
22

33
on:
44
push:
5+
pull_request:
56
workflow_call:
67

78
jobs:

.github/workflows/unittest.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Unittest
22

33
on:
44
push:
5+
pull_request:
56
workflow_call:
67

78
jobs:

0 commit comments

Comments
 (0)