Skip to content

Commit 49c2e1c

Browse files
committed
update test action to check for expected failure condition
1 parent 204e1b4 commit 49c2e1c

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/test-action.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,26 @@ jobs:
6969
7070
Write-Output $issueAsJsonIndented
7171
if($expectedIssueAsJson -eq $issueAsJsonIndented) {
72-
Write-Output "::notice::Action produced the expected output. See the output from the step 'Output and assert parsed issue'."
72+
Write-Output "::notice title=Action check::Action produced the expected output. See the output from the step 'Output and assert parsed issue'."
7373
}
7474
else {
75-
Write-Output "::error::Action didn't produce expected output. See the output from the step 'Output and assert parsed issue'."
75+
Write-Output "::error title=Action check::Action didn't produce expected output. See the output from the step 'Output and assert parsed issue'."
7676
Exit -1
7777
}
78-
78+
- name: Run GitHub issue forms parser with bad input
79+
id: issue-parser-bad-input
80+
uses: edumserrano/github-issue-forms-parser@v1
81+
continue-on-error: true
82+
with:
83+
template-filepath: '${{ steps.args.outputs.template-filepath }}'
84+
issue-form-body: '{}'
85+
- name: The action should fail if it fails to parse
86+
run: |
87+
$parseStepWithBadInputOutcome = '${{ steps.issue-parser-bad-input.outcome }}''
88+
if($parseStepWithBadInputOutcome -eq 'success') {
89+
Write-Output "::error title=Action check:Action should have failed the workflow because of invalid input but it didn't'."
90+
Exit 1
91+
}
92+
else {
93+
Write-Output "::notice title=Action check::Action would have failed the workflow given invalid input."
94+
}

0 commit comments

Comments
 (0)