Testing failures #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Testing failures | |
run-name: "Testing failures" | |
on: | |
workflow_dispatch: | |
inputs: | |
cndtion: | |
required: true | |
type: string | |
default: "0" | |
description: 'cndtion: could be 0/1. main-job will fail if 0, in case of 1 it will finish successfully' | |
jobs: | |
main-job: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- name: run main job | |
run: | | |
set | |
if [ ${{ inputs.cndtion }} -eq 0 ]; then exit 1 ; fi | |
on-failure-job: | |
needs: [ main-job ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: test | |
run: | | |
echo ${{ job.main-job.status }} | jq . | |