-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.96 KB
/
testing-triggers.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
55
56
57
58
59
60
61
62
63
64
65
66
name: "Testing Workflow Trigger Conditionals"
on:
schedule:
- cron: "* * * * *" # run every minute
workflow_dispatch:
workflow_call:
inputs:
test:
type: string
permissions: read-all
jobs:
job_schedule:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name == 'schedule' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"
job_not_schedule:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name != 'schedule' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"
job_workflow_dispatch:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"
job_not_workflow_dispatch:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name != 'workflow_dispatch' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"
job_workflow_call:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name == 'workflow_call' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"
job_not_workflow_call:
runs-on: ubuntu-latest
steps:
- name: Set output
if: ${{ github.event_name != 'workflow_call' }}
run: |
echo "running with ${{ github.event.inputs.test }}"
echo "Called by workflow: ${{ github.event.workflow_call.workflow }}"