Skip to content

Commit c6b5b82

Browse files
committed
rework failure handling
1 parent a1b8eda commit c6b5b82

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/test-emit-metrics.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
steps:
3939
- name: Checkout sources
4040
uses: actions/checkout@v4
41-
- name: Fail to emit some test metrics
41+
- id: expected-failure
42+
name: Fail to emit some test metrics
4243
uses: ./.github/actions/emit-metrics
4344
continue-on-error: true
4445
with:
@@ -51,9 +52,12 @@ jobs:
5152
BuildTime:4.532:Seconds
5253
BuildSucceeded:1:Count
5354
- name: Handle expected failure
54-
if: ${{ failure() }}
5555
shell: bash
5656
run: |
57-
echo Saw expected failure from attempting to emit metrics when kat isn't installed.
58-
echo All good now!
59-
exit 0
57+
if [[ ${{ steps.expected-failure.outcome }} == "failure" ]]; then
58+
echo Saw expected failure from attempting to emit metrics when kat isn't installed.
59+
exit 0
60+
else
61+
echo Expected failure from previous step!
62+
exit 1
63+
fi

0 commit comments

Comments
 (0)