Skip to content

Commit c42740f

Browse files
Updated dependabot logic
1 parent 6320092 commit c42740f

1 file changed

Lines changed: 62 additions & 2 deletions

File tree

.github/workflows/dependabot-merge.yml

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request_target:
55
types:
66
- labeled
7+
- opened
8+
- reopened
9+
- closed
710

811
jobs:
912
comment:
@@ -13,6 +16,7 @@ jobs:
1316
env:
1417
GITHUB_CONTEXT: ${{ toJson(github) }}
1518
run: echo "$GITHUB_CONTEXT"
19+
1620
- name: Dump job context
1721
env:
1822
JOB_CONTEXT: ${{ toJson(job) }}
@@ -30,8 +34,64 @@ jobs:
3034
ref: master
3135
- name: Dependabot Commenter
3236
if: |
33-
(github.event.label.name == ':shipit: merge') && (github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'dependabot-preview[bot]')
34-
uses: peaceiris/actions-label-commenter@v1.9.1
37+
(
38+
(
39+
github.event.action == 'labeled'
40+
&& (
41+
contains(github.event.label.name, ':shipit: merge')
42+
|| contains(github.event.label.name, 'javascript')
43+
|| contains(github.event.label.name, 'github-actions')
44+
)
45+
)
46+
||
47+
(
48+
contains(github.event.action, 'opened') &&
49+
(
50+
(
51+
contains(github.event.pull_request.labels.*.name, ':shipit: merge')
52+
|| contains(github.event.pull_request.labels.*.name, 'javascript')
53+
|| contains(github.event.pull_request.labels.*.name, 'github-actions')
54+
)
55+
|| startsWith(github.event.pull_request.title, 'Bump JetBrains.ReSharper.CommandLineTools')
56+
|| startsWith(github.event.pull_request.title, 'Bump ReportGenerator')
57+
|| startsWith(github.event.pull_request.title, 'Bump Nuke.Common')
58+
|| startsWith(github.event.pull_request.title, 'Bump GitVersion.Tool')
59+
|| startsWith(github.event.pull_request.title, 'Bump Bogus')
60+
|| startsWith(github.event.pull_request.title, 'Bump coverlet')
61+
|| startsWith(github.event.pull_request.title, 'Bump FakeItEasy')
62+
|| startsWith(github.event.pull_request.title, 'Bump FluentAssertions')
63+
|| startsWith(github.event.pull_request.title, 'Bump xunit')
64+
|| startsWith(github.event.pull_request.title, 'Bump Microsoft.NET.Test.Sdk')
65+
)
66+
)
67+
) && (
68+
github.event.pull_request.user.login == 'dependabot[bot]'
69+
|| github.event.pull_request.user.login == 'dependabot-preview[bot]'
70+
)
71+
uses: peaceiris/actions-label-commenter@v1.10.0
3572
with:
3673
github_token: ${{ secrets.RSG_BOT_TOKEN }}
3774
config_file: .github/label-commenter-dependabot.yml
75+
76+
- name: GitHub Automerge
77+
if: |
78+
(
79+
github.event.label.name == ':shipit: merge'
80+
&& github.event.pull_request.user.login != 'dependabot[bot]'
81+
&& github.event.pull_request.user.login != 'dependabot-preview[bot]'
82+
)
83+
uses: alexwilson/enable-github-automerge-action@1.0.0
84+
with:
85+
github-token: "${{ secrets.GITHUB_TOKEN }}"
86+
merge-method: "SQUASH"
87+
88+
- name: GitHub Remove Labels
89+
if: |
90+
github.event.action == 'closed'
91+
uses: actions-ecosystem/action-remove-labels@v1
92+
with:
93+
labels: |
94+
:shipit: merge
95+
github-actions
96+
javascript
97+
.NET

0 commit comments

Comments
 (0)