From 2c24d17eb1680e22d77c75e5489aa9df2cf9b37e Mon Sep 17 00:00:00 2001 From: hangpersonal Date: Thu, 16 Oct 2025 22:57:28 -0700 Subject: [PATCH] Update manual_trigger.yaml --- .gitea/workflows/manual_trigger.yaml | 37 +++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/manual_trigger.yaml b/.gitea/workflows/manual_trigger.yaml index 3f81c65..0bad95b 100644 --- a/.gitea/workflows/manual_trigger.yaml +++ b/.gitea/workflows/manual_trigger.yaml @@ -1,12 +1,37 @@ -name: "Hello World" +name: Conditional Steps # Name of workflow on: - workflow_dispatch: # Trigger the workflow manually + workflow_dispatch: jobs: - say_hello_job: # Name of job - runs-on: ubuntu-latest # Environment of runner + example_job: + runs-on: ubuntu-latest steps: - - name: Echo Hello World # Name of steps - run: echo "Hello, World!" # Command of steps \ No newline at end of file + - name: Step 1 - Exit Code 0 + 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" \ No newline at end of file