Skip to content

Commit 6117b6a

Browse files
authored
chore(ci): fix description check (#14947)
1 parent 8cf2470 commit 6117b6a

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/pr.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- edited
1010
- ready_for_review
1111
- converted_to_draft
12+
pull_request:
1213

1314
permissions:
1415
pull-requests: write
@@ -157,52 +158,55 @@ jobs:
157158
let testsChecked = false;
158159
let changesChecked = false;
159160
for (const line of body.split('\n')) {
160-
if (line ==="## Tests") {
161+
if (line.includes("## Tests")) {
161162
section = "tests";
163+
core.info('checking section: tests');
162164
continue;
163-
} else if (line === "## Type of change") {
165+
} else if (line.includes("## Type of change")) {
164166
section = "changes";
167+
core.info('checking section: changes');
165168
continue;
166169
}
167170
if (section === "tests") {
168171
if (line.startsWith("- [x] ")) {
169172
testsChecked = true;
170-
core.setOutput('tests', 'fulfilled');
173+
core.info(`tests checked: ${line}`);
174+
core.setOutput('tests', 'checked');
171175
continue;
172176
}
173-
}
174-
if (section === "changes") {
177+
} else if (section === "changes") {
175178
if (line.startsWith("- [x] ")) {
176179
changesChecked = true;
177-
core.setOutput('changes', 'fulfilled');
180+
core.info(`type of change checked: ${line}`);
181+
core.setOutput('changes', 'checked');
178182
continue;
179183
}
180184
}
181185
}
182186
if (!testsChecked) {
183-
core.setOutput('tests', 'not-fulfilled');
187+
core.setOutput('tests', 'not-checked');
184188
core.setFailed('Tests are not checked');
185189
}
186190
if (!changesChecked) {
187-
core.setOutput('changes', 'not-fulfilled');
191+
core.setOutput('changes', 'not-checked');
188192
core.setFailed('Type of Changes are not checked');
189193
}
190194
- name: Delete Comment for Tests
191-
if: always() && steps.check.outputs.tests == 'fullfilled'
195+
if: always() && steps.check.outputs.tests == 'checked'
192196
uses: everpcpc/comment-on-pr-action@v1
193197
with:
194198
token: ${{ github.token }}
195199
identifier: 'pr-assistant-description-tests'
196200
delete: true
197201
- name: Delete Comment for Changes
198-
if: always() && steps.check.outputs.changes == 'fullfilled'
202+
if: always() && steps.check.outputs.changes == 'checked'
199203
uses: everpcpc/comment-on-pr-action@v1
200204
with:
201205
token: ${{ github.token }}
202206
identifier: 'pr-assistant-description-changes'
203207
delete: true
204208
- name: Comment on PR for Tests
205-
if: always() && steps.check.outputs.tests != 'fullfilled'
209+
if: always() && steps.check.outputs.tests != 'checked'
206210
uses: everpcpc/comment-on-pr-action@v1
207211
with:
208212
token: ${{ github.token }}
@@ -211,7 +215,7 @@ jobs:
211215
At least one test kind must be checked in the PR description.
212216
@${{ github.event.pull_request.user.login }} please update it 🙏.
213217
- name: Comment on PR for Changes
214-
if: always() && steps.check.outputs.changes != 'fullfilled'
218+
if: always() && steps.check.outputs.changes != 'checked'
215219
uses: everpcpc/comment-on-pr-action@v1
216220
with:
217221
token: ${{ github.token }}

0 commit comments

Comments
 (0)