9
9
- edited
10
10
- ready_for_review
11
11
- converted_to_draft
12
+ pull_request :
12
13
13
14
permissions :
14
15
pull-requests : write
@@ -157,52 +158,55 @@ jobs:
157
158
let testsChecked = false;
158
159
let changesChecked = false;
159
160
for (const line of body.split('\n')) {
160
- if (line === "## Tests") {
161
+ if (line.includes( "## Tests") ) {
161
162
section = "tests";
163
+ core.info('checking section: tests');
162
164
continue;
163
- } else if (line === "## Type of change") {
165
+ } else if (line.includes( "## Type of change") ) {
164
166
section = "changes";
167
+ core.info('checking section: changes');
165
168
continue;
166
169
}
167
170
if (section === "tests") {
168
171
if (line.startsWith("- [x] ")) {
169
172
testsChecked = true;
170
- core.setOutput('tests', 'fulfilled');
173
+ core.info(`tests checked: ${line}`);
174
+ core.setOutput('tests', 'checked');
171
175
continue;
172
176
}
173
- }
174
- if (section === "changes") {
177
+ } else if (section === "changes") {
175
178
if (line.startsWith("- [x] ")) {
176
179
changesChecked = true;
177
- core.setOutput('changes', 'fulfilled');
180
+ core.info(`type of change checked: ${line}`);
181
+ core.setOutput('changes', 'checked');
178
182
continue;
179
183
}
180
184
}
181
185
}
182
186
if (!testsChecked) {
183
- core.setOutput('tests', 'not-fulfilled ');
187
+ core.setOutput('tests', 'not-checked ');
184
188
core.setFailed('Tests are not checked');
185
189
}
186
190
if (!changesChecked) {
187
- core.setOutput('changes', 'not-fulfilled ');
191
+ core.setOutput('changes', 'not-checked ');
188
192
core.setFailed('Type of Changes are not checked');
189
193
}
190
194
- name : Delete Comment for Tests
191
- if : always() && steps.check.outputs.tests == 'fullfilled '
195
+ if : always() && steps.check.outputs.tests == 'checked '
192
196
uses : everpcpc/comment-on-pr-action@v1
193
197
with :
194
198
token : ${{ github.token }}
195
199
identifier : ' pr-assistant-description-tests'
196
200
delete : true
197
201
- name : Delete Comment for Changes
198
- if : always() && steps.check.outputs.changes == 'fullfilled '
202
+ if : always() && steps.check.outputs.changes == 'checked '
199
203
uses : everpcpc/comment-on-pr-action@v1
200
204
with :
201
205
token : ${{ github.token }}
202
206
identifier : ' pr-assistant-description-changes'
203
207
delete : true
204
208
- name : Comment on PR for Tests
205
- if : always() && steps.check.outputs.tests != 'fullfilled '
209
+ if : always() && steps.check.outputs.tests != 'checked '
206
210
uses : everpcpc/comment-on-pr-action@v1
207
211
with :
208
212
token : ${{ github.token }}
@@ -211,7 +215,7 @@ jobs:
211
215
At least one test kind must be checked in the PR description.
212
216
@${{ github.event.pull_request.user.login }} please update it 🙏.
213
217
- name : Comment on PR for Changes
214
- if : always() && steps.check.outputs.changes != 'fullfilled '
218
+ if : always() && steps.check.outputs.changes != 'checked '
215
219
uses : everpcpc/comment-on-pr-action@v1
216
220
with :
217
221
token : ${{ github.token }}
0 commit comments