forked from AuthorizeNet/sample-code-java
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 889 Bytes
/
CallReusableWorkflow.yml
File metadata and controls
34 lines (31 loc) · 889 Bytes
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
name: Dynamic Dependencies Example
on:
workflow_dispatch:
inputs:
Branch:
description: 'Enter Sprint branch'
type: string
required: true
default: master
env:
SKIP_JOB2: false # Environment variable to simulate dynamic behavior
jobs:
job1:
runs-on: ubuntu-latest
outputs:
proceed_to_job2: ${{ steps.set-output.outputs.proceed }}
steps:
- name: Decide whether to proceed to Job2
id: set-output
run: |
echo "##[set-output name=proceed;]true"; RC=$? # Change to 'false' to simulate skipping
echo $RC
- name: Job 1 Execution
run: echo "Job 1 completed."
job2:
runs-on: ubuntu-latest
needs: job1
if: ${{ needs.job1.outputs.proceed_to_job2 == 'true' }}
steps:
- name: Job 2 Execution
run: echo "Job 2 is running because Job 1 allowed it."