-
Notifications
You must be signed in to change notification settings - Fork 5
35 lines (31 loc) · 1.15 KB
/
workflow-dispatch.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
name: Workflow Dispatch branch detection
on:
workflow_dispatch:
jobs:
detection:
runs-on: ${{ vars.RUNNER_UBUNTU }}
steps:
- name: Get ref by env var
run: echo "Ref $GITHUB_REF"
- name: Get event_name by env var
run: echo "Event name $GITHUB_EVENT_NAME"
- name: Get ref
run: echo "Ref ${{ github.ref }}"
- name: Get event_name
run: echo "Event name ${{ github.event_name }}"
- name: Get event.ref
run: echo "Event ref ${{ github.event.ref }}"
conditional_run_master_branch:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.event.ref == 'refs/heads/master'
runs-on: ${{ vars.RUNNER_UBUNTU }}
needs: detection
steps:
- name: Message
run: echo "I have been triggered because run from master branch"
conditional_run_other_branch:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.event.ref != 'refs/heads/master'
runs-on: ${{ vars.RUNNER_UBUNTU }}
needs: detection
steps:
- name: Message
run: echo "I have been triggered because run from non-master branch"