From 2d303aab53b2cc955ee580d031c1fbbaeee65b63 Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Tue, 19 Dec 2023 11:10:53 +0100 Subject: [PATCH] Don't update the deployment if we didn't start it (#4995) --- .github/workflows/cd.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0f1c0133..8ba7cb4a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -128,7 +128,11 @@ jobs: - name: Update ${{ matrix.images.environment }} Deployment uses: bobheadxi/deployments@v1.4.0 - if: always() + # We depend on the 'deployment' step outputs, so we can't run this step + # if the 'deployment' step didn't run. This can happen if any step + # before the 'deployment' step fails. That's why 'always()' is not + # suitable here. + if: steps.deployment.conclusion != 'cancelled' && steps.deployment.conclusion != 'skipped' with: step: finish token: ${{ secrets.GITHUB_TOKEN }}