Skip to content

Commit c0dccff

Browse files
jobs workflow example
1 parent dbea1fd commit c0dccff

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/jobs.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Dep Jobs Example"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
jobs:
7+
job1:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: "Job 1 Step"
11+
run: echo "Hello"
12+
job2:
13+
runs-on: ubuntu-latest
14+
needs: job1
15+
steps:
16+
- name: "Job 2 Step"
17+
run: echo "World"
18+
- name: "Show Job 1 Output"
19+
run: echo "Job 1 completed successfully!"
20+
if: ${{ needs.job1.result == 'success' }}
21+
- name: "Failing Step in Job 2"
22+
run: exit 1

0 commit comments

Comments
 (0)