From f5eb4315426864d24bb87a050254f46770ad845a Mon Sep 17 00:00:00 2001 From: Pavel Tetyuev Date: Mon, 9 Sep 2024 14:28:42 +0400 Subject: [PATCH] Add condition example (#38) --- .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..5611347 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