Skip to content

09 - Using Functions #4

09 - Using Functions

09 - Using Functions #4

Workflow file for this run

name: 09 - Using Functions
on:
pull_request:
workflow_dispatch:
jobs:
echo1:
runs-on: ubuntu-latest
steps:
- 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."