diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ff4c16..9e92ee6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,3 +79,21 @@ jobs: run: >- /opt/puppetlabs/bolt/bin/bolt plan run puppetsync options='{"list_pipeline_stages": true}' + + # The one check for branch protection to require: GitHub only blocks a + # merge on checks listed by name, and this job fails unless every job it + # needs succeeded. Add any new job in this workflow to `needs:`. + all-checks: + name: 'All checks' + if: always() + needs: + - spec + - bolt + runs-on: ubuntu-latest + steps: + - name: 'Fail unless every needed job succeeded' + env: + NEEDS: ${{ toJSON(needs) }} + run: | + jq -r 'to_entries[] | "\(.key): \(.value.result)"' <<< "$NEEDS" + jq -e 'all(.[]; .result == "success")' <<< "$NEEDS" > /dev/null