From 4712293fcb71be479aeef2b26409fe74bb19fcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulises=20Gasc=C3=B3n?= Date: Thu, 18 Apr 2024 17:13:44 +0200 Subject: [PATCH] chore: improve logic --- .github/workflows/integration-tests.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 3e4753b869..a967a30548 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -53,12 +53,15 @@ jobs: echo "Workflow did not complete within the expected time" fi - if [[ "$status" != "completed" ]]; then - echo "Workflow failed. Current status: $status" + # Get the conclusion of the workflow run + conclusion=$(echo "$response" | jq -r .conclusion) + + if [[ "$status" == "completed" && "$conclusion" != "success" ]]; then + echo "Workflow completed but failed. Conclusion: $conclusion" exit 1 fi - if [[ "$status" == "completed" ]]; then - echo "Workflow has been completed" + if [[ "$status" == "completed" && "$conclusion" == "success" ]]; then + echo "Workflow has been completed successfully" exit 0 fi \ No newline at end of file