Skip to content

Commit

Permalink
Always run all-jobs-pass to ensure all jobs have passed (#1120)
Browse files Browse the repository at this point in the history
Always run 'all-jobs-pass' to ensure all jobs have passed
  • Loading branch information
Mrtenz authored Mar 3, 2023
1 parent 0b3b7e9 commit 782004d
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 782004d

Please sign in to comment.