Skip to content

Commit

Permalink
Fix "All required checks done" CI job to never be skipped (G-Research…
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi authored Aug 11, 2023
1 parent dee4fd8 commit f9d3b2a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ jobs:
# Virtual job that can be configured as a required check before a PR can be merged.
all-required-checks-done:
name: All required checks done
if: ${{ always() }}
needs:
- lint
- golang-unit-tests
Expand All @@ -256,7 +257,15 @@ jobs:
- build-image
runs-on: ubuntu-latest
steps:
- run: echo "All required checks done"
- uses: actions/github-script@v6
with:
script: |
const results = ${{ toJSON(needs.*.result) }};
if (results.every(res => res === 'success')) {
core.info('All required checks succeeded');
} else {
core.setFailed('Some required checks failed');
}
# Publish any push to a branch or tag to ghcr.io as a convenience
# Actual release to Docker Hub happens in a different workflow
Expand Down

0 comments on commit f9d3b2a

Please sign in to comment.