@@ -3,18 +3,7 @@ name: contrib
3
3
on :
4
4
issue_comment :
5
5
types : [created]
6
- pull_request_target :
7
- types :
8
- - opened
9
- - closed
10
- - synchronize
11
- - labeled
12
- - unlabeled
13
- - opened
14
- - reopened
15
- - edited
16
- # For jobs that don't run on draft PRs.
17
- - ready_for_review
6
+ pull_request :
18
7
19
8
permissions :
20
9
contents : read
@@ -24,31 +13,36 @@ concurrency: pr-${{ github.ref }}
24
13
25
14
jobs :
26
15
# Dependabot is annoying, but this makes it a bit less so.
27
- auto-approve- dependabot :
16
+ dependabot :
28
17
runs-on : ubuntu-latest
29
18
if : github.event_name == 'pull_request_target'
30
19
permissions :
31
20
pull-requests : write
32
- steps :
33
- - name : Harden Runner
34
- uses : step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
21
+ steps :
22
+ - name : Dependabot metadata
23
+ id : metadata
24
+ uses : dependabot/fetch-metadata@4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d # v2.2.0
35
25
with :
36
- egress-policy : audit
37
-
38
- - name : auto-approve dependabot
39
- uses : hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
40
- if : github.actor == 'dependabot[bot]'
26
+ github-token : " ${{ secrets.GITHUB_TOKEN }}"
27
+
28
+ - name : Approve the PR
29
+ run : gh pr review --approve "$PR_URL"
30
+ env :
31
+ PR_URL : ${{github.event.pull_request.html_url}}
32
+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
33
+
34
+ - name : Enable auto-merge for Dependabot PRs
35
+ if : steps.metadata.outputs.update-type == 'version-update:semver-patch'
36
+ run : gh pr merge --auto --merge "$PR_URL"
37
+ env :
38
+ PR_URL : ${{github.event.pull_request.html_url}}
39
+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
41
40
42
41
cla :
43
42
runs-on : ubuntu-latest
44
43
permissions :
45
44
pull-requests : write
46
45
steps :
47
- - name : Harden Runner
48
- uses : step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
49
- with :
50
- egress-policy : audit
51
-
52
46
- name : cla
53
47
if : (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
54
48
uses : contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
71
65
# Skip tagging for draft PRs.
72
66
if : ${{ github.event_name == 'pull_request_target' && !github.event.pull_request.draft }}
73
67
steps :
74
- - name : Harden Runner
75
- uses : step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
76
- with :
77
- egress-policy : audit
78
-
79
68
- name : release-labels
80
69
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
81
70
with :
0 commit comments