09 - Using Functions #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |