-
Notifications
You must be signed in to change notification settings - Fork 0
/
kube-prow-bot.yaml
178 lines (159 loc) · 5.42 KB
/
kube-prow-bot.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Kube Prow Bot
on:
issue_comment:
types:
- created
- edited
pull_request_review_comment:
types:
- created
- edited
pull_request_review:
types:
- submitted
- edited
issues:
types:
- opened
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
pull_request_target:
types:
- opened
env:
# REVIEWERS: |-
# Xunzhuo
# APPROVERS: |-
# Xunzhuo
# MAINTAINERS: |-
# Xunzhuo
# This commands is for anyone who can use it
COMMON_PLUGINS: |-
assign
unassign
kind
remove-kind
cc
uncc
# This commands is for author of issue or PR
AUTHOR_PLUGINS: |-
retest
# This commands is for organization member or repository member
MEMBERS_PLUGINS: |-
good-first-issue
help-wanted
close
reopen
# This commands is for in the REVIEWERS environment variable
REVIEWERS_PLUGINS: |-
area
remove-area
lgtm
hold
retitle
# This commands is for in the APPROVERS environment variable
APPROVERS_PLUGINS: |-
merge
approve
rebase
# This commands is for in the MAINTAINERS environment variable
MAINTAINERS_PLUGINS: |-
milestone
remove-milestone
priority
remove-priority
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPOSITORY: ${{ github.repository }}
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token
permissions:
checks: read
discussions: read
repository-projects: read
statuses: read
contents: write
issues: write
pull-requests: write
actions: write
jobs:
bot:
name: Bot
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Issue Opened
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'issues' }}
env:
LOGIN: ${{ github.event.issue.user.login }}
AUTHOR: ${{ github.event.issue.user.login }}
MESSAGE: ${{ github.event.issue.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
AUTHOR_ASSOCIATION: ${{ github.event.issue.author_association }}
ISSUE_KIND: issue
TYPE: created
GREETING: |-
Hi @${{ github.event.issue.user.login }},
Thanks for opening an issue! 🎉
- name: PR Opened
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'pull_request_target' }}
env:
LOGIN: ${{ github.event.pull_request.user.login }}
AUTHOR: ${{ github.event.pull_request.user.login }}
MESSAGE: ${{ github.event.pull_request.body }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }}
ISSUE_KIND: pr
TYPE: created
GREETING: |-
Hi @${{ github.event.pull_request.user.login }}. Thanks for your PR! 🎉
If the PR is ready, use the `/cc` command to assign reviewer to review.
<details>
<summary>Details</summary>
The full list of commands accepted by this bot can be found [here](https://github.com/Xunzhuo/kube-prow-bot/blob/main/COMMAND.md).
The pull request process is described [here](https://github.com/Xunzhuo/kube-prow-bot/blob/main/PROCESS.md).
</details>
- name: Issue Commented
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'issue_comment' && !github.event.issue.pull_request }}
env:
LOGIN: ${{ github.event.comment.user.login }}
AUTHOR: ${{ github.event.issue.user.login }}
MESSAGE: ${{ github.event.comment.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
ISSUE_KIND: issue
TYPE: comment
- name: PR Review Commented
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'pull_request_review_comment' }}
env:
LOGIN: ${{ github.event.comment.user.login }}
AUTHOR: ${{ github.event.pull_request.user.login }}
MESSAGE: ${{ github.event.comment.body }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
ISSUE_KIND: pr
TYPE: comment
- name: PR Review
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'pull_request_review' }}
env:
LOGIN: ${{ github.event.review.user.login }}
AUTHOR: ${{ github.event.pull_request.user.login }}
MESSAGE: ${{ github.event.review.body }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
ISSUE_KIND: pr
TYPE: comment
- name: PR Commented
uses: Xunzhuo/kube-prow-bot@v1.0.1
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }}
env:
LOGIN: ${{ github.event.comment.user.login }}
AUTHOR: ${{ github.event.issue.user.login }}
MESSAGE: ${{ github.event.comment.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
ISSUE_KIND: pr
TYPE: comment