From 58c4a62d2f93b9d9e4e1c40ceacef166be385b4d Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Sun, 28 Aug 2022 19:56:58 -0400 Subject: [PATCH] ci(deploy): do not run `versioning` job when pushing to `main` (#4970) Previous behavior: When a push was detected in the `main` branch, the workflow would run the `versioning` job and crash trying to detect the version being deployed as there was none. Expected behavior: Do not fail the `versioning` job when pushing to `main` Solution: Limit the `versioning` job to only run when a release event is triggered and allow the `deploy-nodes` job to run even if `versioning` is skipped --- .github/workflows/continous-delivery.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continous-delivery.yml b/.github/workflows/continous-delivery.yml index b896d1ce2..1d3441766 100644 --- a/.github/workflows/continous-delivery.yml +++ b/.github/workflows/continous-delivery.yml @@ -40,6 +40,7 @@ jobs: runs-on: ubuntu-latest outputs: major_version: ${{ steps.set.outputs.major_version }} + if: ${{ github.event_name == 'release' }} steps: - name: Getting Zebrad Version id: get @@ -87,7 +88,7 @@ jobs: permissions: contents: 'read' id-token: 'write' - if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'release' }} + if: ${{ !cancelled() && !failure() && ((github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'release') }} steps: - name: Inject slug/short variables