Skip to content

Commit 27e35d3

Browse files
authored
Adjust keywords check in step 3 to cancel gracefully.
1 parent d71ef32 commit 27e35d3

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

.github/workflows/3-step.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,47 @@ env:
1313
STEP_3_FILE: ".github/steps/4-step.md"
1414

1515
jobs:
16-
required_issue_comment_keywords:
16+
check_keywords:
1717
name: Check issue comment text for required keyword
1818
runs-on: ubuntu-latest
1919

20+
outputs:
21+
result: ${{ steps.combine_checks.outputs.result }}
22+
2023
steps:
2124
- name: Check for professortocat reference
25+
id: check_professortocat
2226
uses: skills/action-keyphrase-checker@v1
27+
continue-on-error: true
2328
with:
2429
text: ${{ github.event.comment.body }}
2530
keyphrase: "professortocat"
2631
case-sensitive: false
2732
minimum-occurrences: 1
2833

2934
- name: Check for alert reference
35+
id: check_alert
3036
uses: skills/action-keyphrase-checker@v1
37+
continue-on-error: true
3138
with:
3239
text: ${{ github.event.comment.body }}
3340
keyphrase: "alert"
3441
case-sensitive: false
3542
minimum-occurrences: 1
3643

44+
- name: Set continue output if both checks succeeded
45+
id: combine_checks
46+
run: |
47+
if [[ "${{ steps.check_professortocat.outcome }}" == "success" && "${{ steps.check_alert.outcome }}" == "success" ]]; then
48+
echo "result=success" >> "$GITHUB_OUTPUT"
49+
else
50+
echo "result=fail" >> "$GITHUB_OUTPUT"
51+
fi
52+
3753
find_exercise:
38-
needs: [required_issue_comment_keywords]
54+
needs: [check_keywords]
3955
name: Find Exercise Issue
56+
if: needs.check_keywords.outputs.result == 'success'
4057
uses: skills/exercise-toolkit/.github/workflows/[email protected]
4158

4259
post_next_step_content:

0 commit comments

Comments
 (0)