forked from ExamProCo/Github-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1.02 KB
/
conditional+functions.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
name: Conditions + Functions Workflow
on:
workflow_dispatch:
inputs:
name:
description: Just a name
type: string
required: false
fullload:
description: Defines if all steps of the jobs should be run.
type: boolean
required: true
jobs:
print-inputs:
if: inputs.fullload
runs-on: ubuntu-latest
steps:
- id: printing-name
name: Printing name
run: echo "${{inputs.name}}"
- id: checking-name
name: Checking name
if: ${{startsWith(inputs.name, 'V')}}
run: echo "The name is a valid ''V' name"
- id: completion
name: Completion
if: ${{success()}}
run: echo "Well done!"
print-functions:
runs-on: ubuntu-latest
steps:
- id: inputs-concatenation
name: Inputs Concatenation
run: echo ${{join(inputs.*, ',')}}
- id: github-concatenation
name: GitHub Concatenation
run: echo ${{join(runner.*, ',')}}