-
-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (89 loc) · 2.48 KB
/
workflow-dispatch.yml
File metadata and controls
96 lines (89 loc) · 2.48 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
name: Workflow Dispatch
on:
workflow_dispatch:
inputs:
name:
description: 'Person to greet'
required: true
default: 'Mona the Octocat'
home:
description: 'location'
required: false
default: 'The Octoverse'
jobs:
manually-triggered-workflow:
runs-on: ubuntu-latest
steps:
- run: |
echo "Hello ${{ inputs.name }}!"
echo "- in ${{ inputs.home }}!"
- if: inputs.name == 'Mona'
run: echo "Name is Mona"
- if: inputs.name != 'Mona'
run: echo "Name is not Mona"
- if: contains(inputs.name, 'Mona')
run: echo "Name contains Mona"
- if: contains(inputs.name, 'Mona') == false
run: echo "Name does not contain Mona"
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
# on:
# workflow_dispatch:
# inputs:
# logLevel:
# description: 'Log level'
# required: true
# default: 'warning'
# type: choice
# options:
# - info
# - warning
# - debug
# tags:
# description: 'Test scenario tags'
# required: false
# type: boolean
# environment:
# description: 'Environment to run tests against'
# type: environment
# required: true
#
# jobs:
# log-the-inputs:
# runs-on: ubuntu-latest
# steps:
# - run: |
# echo "Log level: $LEVEL"
# echo "Tags: $TAGS"
# echo "Environment: $ENVIRONMENT"
# env:
# LEVEL: ${{ inputs.logLevel }}
# TAGS: ${{ inputs.tags }}
# ENVIRONMENT: ${{ inputs.environment }}
# https://github.blog/changelog/2021-11-10-github-actions-input-types-for-manual-workflows/
# name: Mixed inputs
#
# on:
# workflow_dispatch:
# inputs:
# name:
# type: choice
# description: Who to greet
# options:
# - monalisa
# - cschleiden
# message:
# required: true
# use-emoji:
# type: boolean
# description: Include 🎉🤣 emojis
# environment:
# type: environment
#
# jobs:
# greet:
# runs-on: ubuntu-latest
#
# steps:
# - name: Send greeting
# run: echo "${{ github.event.inputs.message }} ${{ fromJSON('["", "🥳"]')[github.event.inputs.use-emoji == 'true'] }} ${{ github.event.inputs.name }}"