From 6a9d4ed3cd5181b2183f3315b3afd9e046d8db0e Mon Sep 17 00:00:00 2001 From: jetexe Date: Mon, 9 Sep 2024 13:39:16 +0400 Subject: [PATCH] Add condition example --- .github/workflows/tests.yml | 6 ++++++ README.md | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b7fc61e..4d33f8d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -131,3 +131,9 @@ jobs: shell: sh post: if [ "$0" = "/usr/bin/bash" ]; then echo "Test passed"; else exit 1; fi post-shell: bash + + - name: Post run condition + uses: ./ + with: + run: echo "Use job.status variable to check the job status (success, failure or cancelled)" + post: if ${{ job.status }} == "success"; then echo "Test passed"; else exit 1; fi diff --git a/README.md b/README.md index 321df5c..e7ddc29 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,8 @@ This above configuration will produce the following: ![CI output example](https://github.com/gacts/run-and-post-run/assets/7326800/a73d2138-c773-494a-9922-2ae182ba87d5) +More examples can be found in the [tests](./.github/workflows/tests.yml). + ## Customizing ### Inputs