-
Notifications
You must be signed in to change notification settings - Fork 73
36 lines (34 loc) · 1.09 KB
/
09-function.yaml
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
name: 09 - Using Functions
on:
pull_request:
workflow_dispatch:
jobs:
echo1:
runs-on: ubuntu-latest
steps:
- name: Print PR title
run: echo "${{ github.event.pull_request.title }}"
- name: Print PR labels
run: |
cat << EOF
${{ toJSON(github.event.pull_request.labels) }}
EOF
- name: Bug step
if: ${{ !cancelled() && contains(github.event.pull_request.title, 'fix') }}
run: echo "I am a bug fix"
- name: Sleep for 20 seconds
run: sleep 20
- name: Failing step
run: exit 1
- name: I will be skipped
if: ${{ success() }}
run: echo "I will print if previous steps succeed."
- name: I will execute
if: ${{ failure() }}
run: echo "I will print if any previous step fails."
- name: I will execute
if: ${{ !cancelled() }}
run: echo "I will always print, except when the workflow is cancelled."
- name: I will execute when cancelled
if: ${{ cancelled() }}
run: echo "I will print if the workflow has been cancelled."