-
Notifications
You must be signed in to change notification settings - Fork 29
54 lines (46 loc) · 1.02 KB
/
workflow-logic-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Workflow Logic Test
run-name: Workflow Logic Test
on:
workflow_dispatch:
inputs:
fail-job-2:
description: 'Job2 should fail?'
type: boolean
required: true
permissions:
contents: read # This is required for actions/checkout
jobs:
job1:
name: Job 1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
job2:
name: Job 2
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fail Job = TRUE
if: ${{ github.event.inputs.fail-job-2 == true }}
run: exit 1
- name: Fail Job = FALSE
if: ${{ ! github.event.inputs.fail-job-2 == false }}
run: exit 0
job3:
name: Job 3
runs-on: ubuntu-latest
needs: [job1, job2]
if: ${{ always() }}
steps:
- name: Checkout
uses: actions/checkout@v4
job4:
name: Job 4
runs-on: ubuntu-latest
needs: job3
if: ${{ success() }}
steps:
- name: Checkout
uses: actions/checkout@v4