File tree Expand file tree Collapse file tree 1 file changed +19
-20
lines changed Expand file tree Collapse file tree 1 file changed +19
-20
lines changed Original file line number Diff line number Diff line change @@ -59,29 +59,28 @@ jobs:
59
59
uses : actions/checkout@v4
60
60
- name : run action
61
61
uses : ./
62
+ id : action-run
62
63
with :
63
64
environment-paths : " ${{ toJSON(matrix.env-paths) }}"
64
- - name : setup status
65
+ - name : detect outcome
65
66
if : always()
66
67
shell : bash -l {0}
67
68
run : |
68
- echo "${{ success() }} vs ${{ failure() }}"
69
- echo "STATUS=0" >> $GITHUB_ENV
70
- - name : detect unexpected failures
71
- if : |
72
- failure() && ${{ matrix.expected-failure }} == "false"
73
- shell : bash -l {0}
74
- run : |
75
- echo "unexpected failure"
76
- echo "STATUS=1" >> $GITHUB_ENV
77
- - name : detect unexpected passes
78
- if : |
79
- success() && ${{ matrix.expected-failure }} == "true"
80
- shell : bash -l {0}
81
- run : |
82
- echo "unexpected pass"
83
- echo "STATUS=2" >> $GITHUB_ENV
84
- - name : evaluate status
85
- shell : bash -l {0}
86
- run : |
69
+ if [[ "${{ steps.action-run.outcome }}" == "success" && ${{ matrix.expected-failure }} == "true" ]]; then
70
+ # unexpected failure
71
+ echo "workflow xpassed"
72
+ echo "STATUS=1" >> $GITHUB_ENV
73
+ elif [[ "${{ steps.action-run.outcome }}" == "failure" && ${{ matrix.expected-failure }} == "false" ]]; then
74
+ # unexpected pass
75
+ echo "workflow failed"
76
+ echo "STATUS=2" >> $GITHUB_ENV
77
+ elif [[ "${{ steps.action-run.outcome }}" == "success" ]]; then
78
+ # normal pass
79
+ echo "passed"
80
+ echo "STATUS=0" >> $GITHUB_ENV
81
+ else
82
+ # cancelled
83
+ echo "workflow cancelled"
84
+ echo "STATUS=3" >> $GITHUB_ENV
85
+ fi
87
86
exit ${{ env.STATUS }}
You can’t perform that action at this time.
0 commit comments