27
27
const regex = /^(rfc|feat|fix|refactor|ci|docs|chore)(\([a-z0-9-]+\))?:/;
28
28
const m = title.match(regex);
29
29
if (!m) {
30
- core.error ('PR title is not semantic');
30
+ core.setFailed ('PR title is not semantic');
31
31
core.setOutput('title', 'not-semantic');
32
32
return;
33
33
}
@@ -66,14 +66,14 @@ jobs:
66
66
});
67
67
core.setOutput('title', 'semantic');
68
68
- name : Delete Comment
69
- if : steps.check.outputs.title == 'semantic'
69
+ if : always() && steps.check.outputs.title == 'semantic'
70
70
uses : everpcpc/comment-on-pr-action@v1
71
71
with :
72
72
token : ${{ github.token }}
73
73
identifier : ' pr-assistant-title'
74
74
delete : true
75
75
- name : Comment on PR
76
- if : steps.check.outputs.title == 'not-semantic'
76
+ if : always() && steps.check.outputs.title == 'not-semantic'
77
77
uses : everpcpc/comment-on-pr-action@v1
78
78
with :
79
79
token : ${{ github.token }}
@@ -113,20 +113,20 @@ jobs:
113
113
const body = context.payload.pull_request.body;
114
114
const regex = /I hereby agree to the terms of the CLA available at: https:\/\/docs.databend.com\/dev\/policies\/cla\//;
115
115
if (!regex.test(body)) {
116
- core.error ('CLA is not signed');
116
+ core.setFailed ('CLA is not signed');
117
117
core.setOutput('cla', 'not-signed');
118
118
} else {
119
119
core.setOutput('cla', 'signed');
120
120
}
121
121
- name : Delete Comment
122
- if : steps.check.outputs.cla == 'signed'
122
+ if : always() && steps.check.outputs.cla == 'signed'
123
123
uses : everpcpc/comment-on-pr-action@v1
124
124
with :
125
125
token : ${{ github.token }}
126
126
identifier : ' pr-assistant-cla'
127
127
delete : true
128
128
- name : Comment on PR
129
- if : steps.check.outputs.cla == 'not-signed'
129
+ if : always() && steps.check.outputs.cla == 'not-signed'
130
130
uses : everpcpc/comment-on-pr-action@v1
131
131
with :
132
132
token : ${{ github.token }}
@@ -153,7 +153,6 @@ jobs:
153
153
with :
154
154
script : |
155
155
const body = context.payload.pull_request.body;
156
- const regex = /- [x] /;
157
156
let section = "summary";
158
157
let testsChecked = false;
159
158
let changesChecked = false;
@@ -166,14 +165,14 @@ jobs:
166
165
continue;
167
166
}
168
167
if (section === "tests") {
169
- if (regex.test(line )) {
168
+ if (line.startsWith("- [x] " )) {
170
169
testsChecked = true;
171
170
core.setOutput('tests', 'fulfilled');
172
171
continue;
173
172
}
174
173
}
175
174
if (section === "changes") {
176
- if (regex.test(line )) {
175
+ if (line.startsWith("- [x] " )) {
177
176
changesChecked = true;
178
177
core.setOutput('changes', 'fulfilled');
179
178
continue;
@@ -182,39 +181,41 @@ jobs:
182
181
}
183
182
if (!testsChecked) {
184
183
core.setOutput('tests', 'not-fulfilled');
185
- core.error ('Tests are not checked');
184
+ core.setFailed ('Tests are not checked');
186
185
}
187
186
if (!changesChecked) {
188
187
core.setOutput('changes', 'not-fulfilled');
189
- core.error ('Type of Changes are not checked');
188
+ core.setFailed ('Type of Changes are not checked');
190
189
}
191
190
- name : Delete Comment for Tests
192
- if : steps.check.outputs.tests == 'fullfilled'
191
+ if : always() && steps.check.outputs.tests == 'fullfilled'
193
192
uses : everpcpc/comment-on-pr-action@v1
194
193
with :
195
194
token : ${{ github.token }}
196
195
identifier : ' pr-assistant-description-tests'
197
196
delete : true
198
197
- name : Delete Comment for Changes
199
- if : steps.check.outputs.changes == 'fullfilled'
198
+ if : always() && steps.check.outputs.changes == 'fullfilled'
200
199
uses : everpcpc/comment-on-pr-action@v1
201
200
with :
202
201
token : ${{ github.token }}
203
202
identifier : ' pr-assistant-description-changes'
204
203
delete : true
205
204
- name : Comment on PR for Tests
206
- if : steps.check.outputs.tests != 'fullfilled'
205
+ if : always() && steps.check.outputs.tests != 'fullfilled'
207
206
uses : everpcpc/comment-on-pr-action@v1
208
207
with :
209
208
token : ${{ github.token }}
210
209
identifier : ' pr-assistant-description-tests'
211
210
body : |
212
- At least one test case must be checked in the PR description.
211
+ At least one test kind must be checked in the PR description.
212
+ @${{ github.event.pull_request.user.login }} please update it 🙏.
213
213
- name : Comment on PR for Changes
214
- if : steps.check.outputs.changes != 'fullfilled'
214
+ if : always() && steps.check.outputs.changes != 'fullfilled'
215
215
uses : everpcpc/comment-on-pr-action@v1
216
216
with :
217
217
token : ${{ github.token }}
218
218
identifier : ' pr-assistant-description-changes'
219
219
body : |
220
220
At least one type of change must be checked in the PR description.
221
+ @${{ github.event.pull_request.user.login }} please update it 🙏.
0 commit comments