From 86153a81a34984125ba034ab33d1755eb0cafae3 Mon Sep 17 00:00:00 2001 From: nzbr Date: Fri, 6 Dec 2024 21:42:47 +0100 Subject: [PATCH] ci: add success gate job --- .github/workflows/on_push.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/on_push.yml b/.github/workflows/on_push.yml index 665af15d..eefed7ec 100644 --- a/.github/workflows/on_push.yml +++ b/.github/workflows/on_push.yml @@ -29,3 +29,36 @@ jobs: docs: name: Docs 📕 uses: ./.github/workflows/run_docs.yml + + success: + name: Pipeline Passed ✅ + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + needs: + - build + - package + - checks + - tests + - docs + steps: + - shell: pwsh + run: | + $status = @( + $("Checks" , "${{ needs.checks.result }}"), + $("Build" , "${{ needs.build.result }}"), + $("Tests" , "${{ needs.tests.result }}"), + $("Package" , "${{ needs.package.result }}"), + $("Docs" , "${{ needs.docs.result }}") + ) | % { + @($_[0], (($_[1] -eq 'success') -or ($_[1] -eq 'skipped'))) + } + + $exit = 0 + $status | % { + Write-Host "[ $($_[1] ? " OK " : "FAIL") ] $_[0]" + if (-not $_[1]) { + $exit = 1 + } + } + + exit $exit