From 782004d2d1d10187b1afde680e4c35be7f8335ce Mon Sep 17 00:00:00 2001 From: Maarten Zuidhoorn Date: Fri, 3 Mar 2023 14:09:53 +0100 Subject: [PATCH] Always run `all-jobs-pass` to ensure all jobs have passed (#1120) Always run 'all-jobs-pass' to ensure all jobs have passed --- .github/workflows/main.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2bf774637..97164454ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,9 +47,26 @@ jobs: secrets: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + all-jobs-complete: + name: All jobs complete + runs-on: ubuntu-latest + needs: lint-build-test + outputs: + passed: ${{ steps.set-output.outputs.passed }} + steps: + - name: Set passed output + id: set-output + run: echo "passed=true" >> "$GITHUB_OUTPUT" + all-jobs-pass: name: All jobs pass + if: ${{ always() }} runs-on: ubuntu-latest - needs: lint-build-test + needs: all-jobs-complete steps: - - run: echo "Great success!" + - name: Check that all jobs have passed + run: | + passed="${{ needs.all-jobs-complete.outputs.passed }}" + if [[ $passed != "true" ]]; then + exit 1 + fi