Skip to content

Commit 686cd9e

Browse files
committed
Only a little needy
1 parent ea54710 commit 686cd9e

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/needs-skipped.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
steps:
6363
- name: Step
6464
run: echo "I am the last step"
65+
# This one gets skipped transitively
6566
vanilla:
6667
runs-on: ubuntu-latest
6768
needs: [one, two]
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Needs skipped
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
should_fail:
6+
description: "Should fail?"
7+
default: "false"
8+
jobs:
9+
one:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- run: echo "Hello, world!"
13+
- run: sleep 10
14+
- name: Fail
15+
if: github.event.inputs.should_fail == 'true'
16+
run: false
17+
two-skipped:
18+
runs-on: ubuntu-latest
19+
if: false
20+
steps:
21+
- run: echo "Empty world."
22+
two:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- run: echo "Empty world but it doesn't get skipped."
26+
two-skipped2:
27+
runs-on: ubuntu-latest
28+
if: false
29+
steps:
30+
- run: echo "Empty world."
31+
32+
end1:
33+
runs-on: ubuntu-latest
34+
needs: [one, two]
35+
if: ${{!cancelled() && !failure()}}
36+
steps:
37+
- run: echo "I am the last step"
38+
end2:
39+
runs-on: ubuntu-latest
40+
needs: [one, two-skipped]
41+
if: ${{!cancelled() && !failure()}}
42+
steps:
43+
- run: echo "I am the last step"
44+
end2:
45+
runs-on: ubuntu-latest
46+
needs: [two-skipped, two-skipped2]
47+
if: ${{!cancelled() && !failure()}}
48+
steps:
49+
- run: echo "I am the last step"

0 commit comments

Comments
 (0)