14
14
- edited
15
15
# For jobs that don't run on draft PRs.
16
16
- ready_for_review
17
- pull_request : # for dependabot PRs
18
- types :
19
- - opened
20
- push :
21
- branches :
22
- - main
23
17
24
18
permissions :
25
19
contents : read
@@ -28,81 +22,6 @@ permissions:
28
22
concurrency : pr-${{ github.ref }}
29
23
30
24
jobs :
31
- # Dependabot is annoying, but this makes it a bit less so.
32
- dependabot-automerge :
33
- runs-on : ubuntu-latest
34
- if : github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'coder/coder'
35
- permissions :
36
- pull-requests : write
37
- contents : write
38
- steps :
39
- - name : Dependabot metadata
40
- id : metadata
41
- uses : dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
42
- with :
43
- github-token : " ${{ secrets.GITHUB_TOKEN }}"
44
-
45
- - name : Approve the PR
46
- run : gh pr review --approve "$PR_URL"
47
- env :
48
- PR_URL : ${{github.event.pull_request.html_url}}
49
- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
50
-
51
- - name : Enable auto-merge
52
- run : gh pr merge --auto --squash "$PR_URL"
53
- env :
54
- PR_URL : ${{github.event.pull_request.html_url}}
55
- GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
56
-
57
- dependabot-automerge-notify :
58
- # Send a slack notification when a dependabot PR is merged.
59
- runs-on : ubuntu-latest
60
- if : github.event_name == 'push' && github.actor == 'github-actions[bot]'
61
- steps :
62
- - name : Send Slack notification
63
- env :
64
- PR_URL : ${{github.event.pull_request.html_url}}
65
- PR_TITLE : ${{github.event.pull_request.title}}
66
- PR_NUMBER : ${{github.event.pull_request.number}}
67
- run : |
68
- curl -X POST -H 'Content-type: application/json' \
69
- --data '{
70
- "username": "dependabot",
71
- "icon_url": "https://avatars.githubusercontent.com/u/27347476",
72
- "blocks": [
73
- {
74
- "type": "header",
75
- "text": {
76
- "type": "plain_text",
77
- "text": ":pr-merged: Auto merged Dependabot PR #${{ env.PR_NUMBER }}",
78
- "emoji": true
79
- }
80
- },
81
- {
82
- "type": "section",
83
- "fields": [
84
- {
85
- "type": "mrkdwn",
86
- "text": "${{ env.PR_TITLE }}"
87
- }
88
- ]
89
- },
90
- {
91
- "type": "actions",
92
- "elements": [
93
- {
94
- "type": "button",
95
- "text": {
96
- "type": "plain_text",
97
- "text": "View PR"
98
- },
99
- "url": "${{ env.PR_URL }}"
100
- }
101
- ]
102
- }
103
- ]
104
- }' ${{ secrets.DEPENDABOT_PRS_SLACK_WEBHOOK }}
105
-
106
25
cla :
107
26
runs-on : ubuntu-latest
108
27
permissions :
0 commit comments