Update manual_trigger.yaml
This commit is contained in:
@@ -1,12 +1,37 @@
|
|||||||
name: "Hello World"
|
name: Conditional Steps # Name of workflow
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: # Trigger the workflow manually
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
say_hello_job: # Name of job
|
example_job:
|
||||||
runs-on: ubuntu-latest # Environment of runner
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Echo Hello World # Name of steps
|
- name: Step 1 - Exit Code 0
|
||||||
run: echo "Hello, World!" # Command of steps
|
id: successful_step
|
||||||
|
run: |
|
||||||
|
echo "exit code 0"
|
||||||
|
exit 0 # Success (exit code 0)
|
||||||
|
shell: bash # If you want you can change the shell per step
|
||||||
|
|
||||||
|
- name: Step 2 - Execute If Previous Succeeded
|
||||||
|
# The syntax bellow ${{}} is expression syntax in github actions
|
||||||
|
# Success and failure are status expressions
|
||||||
|
if: ${{ success() }} # Only run this step if the previous step succeeded
|
||||||
|
run: |
|
||||||
|
echo "Running because the previous step has succeeded"
|
||||||
|
|
||||||
|
- name: Step 3 - I am Failing
|
||||||
|
run: |
|
||||||
|
echo "I am failing"
|
||||||
|
exit 1 # Failure (non-zero exit code)
|
||||||
|
|
||||||
|
- name: Step 4 - I Will Never Execute # Because of failure of Step 3
|
||||||
|
run: |
|
||||||
|
echo "I will never execute"
|
||||||
|
|
||||||
|
- name: Step 5 - Execute on Workflow Failure
|
||||||
|
if: ${{ failure() }} # Only run this step if the workflow failed
|
||||||
|
run: |
|
||||||
|
echo "Workflow failed"
|
||||||
Reference in New Issue
Block a user