From c09bfc0809cac5efe5f35badf6068aa7d10119d0 Mon Sep 17 00:00:00 2001 From: MichalKinas <113341662+MichalKinas@users.noreply.github.com> Date: Mon, 31 Mar 2025 11:59:38 +0200 Subject: [PATCH] [ACS-7241] Fixed if structure to properly run jobs if some are skipped (#4489) * [ACS-7241] Test changes * [ACS-7241] Change condition to always and add additional step for proper verification * [ACS-7241] Echo additional info * [ACS-7241] Echo additional info * [ACS-7241] Echo additional info * [ACS-7241] Echo additional info * [ACS-7241] Fixed if conditionals --- .github/workflows/release.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 382b6b3cf..f81e767c9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -93,13 +93,15 @@ jobs: - run: npm run affected:test -- --browsers=ChromeHeadless --watch=false $TEST_OPTS --base=origin/develop publish-docker-registry: - if: | - always() && - (${{ inputs.publish-to-quay == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }})) + if: ${{ always() }} needs: [lint, unit-tests] name: "Publish to Quay" runs-on: ubuntu-latest steps: + - name: Check previous jobs status + if: ${{ inputs.publish-to-quay == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1 + - name: Checkout uses: actions/checkout@v4 with: @@ -128,13 +130,15 @@ jobs: dry-run: ${{ inputs.dry-run-release }} publish-to-dockerhub: - if: | - always() && - (${{ inputs.publish-to-docker == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }})) + if: ${{ always() }} needs: [lint, unit-tests] name: "Publish to Dockerhub" runs-on: ubuntu-latest steps: + - name: Check previous jobs status + if: ${{ inputs.publish-to-docker == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1 + - name: Checkout uses: actions/checkout@v4 with: @@ -163,13 +167,15 @@ jobs: dry-run: ${{ inputs.dry-run-release }} publish-git-tag: - if: | - always() && - (${{ inputs.publish-git-tag == 'true' }} && (${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }})) + if: ${{ always() }} needs: [lint, unit-tests] name: "Publish Git Tag" runs-on: ubuntu-latest steps: + - name: Check previous jobs status + if: ${{ inputs.publish-git-tag == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1 + - name: Checkout uses: actions/checkout@v4 with: @@ -195,15 +201,17 @@ jobs: dry-run: ${{ inputs.dry-run-release }} publish-libs: - if: | - always() && - (${{ inputs.publish-to-npm == 'true' }} && ( ${{ needs.unit-tests.result == 'success' }} || ${{ needs.unit-tests.result == 'skipped' }})) + if: ${{ always() }} needs: [lint, unit-tests] name: "Publish libs to NPM and GitHub registry" runs-on: ubuntu-latest permissions: packages: write steps: + - name: Check previous jobs status + if: ${{ inputs.publish-to-npm == 'false' || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1 + - name: Checkout uses: actions/checkout@v4 with: