A Github Action which suceeds only if all the dependent jobs succeeded.
This is useful when configuring a required status check for a branch protection rule in Github: it avoids the need to specify a potentally large number of status checks.
One particular advantage of such a branch protection rule is that Github offers you an "auto-merge" feature that will merge a pull request as soon as the required checks complete.
Add a job like this to your workflow definition:
jobs:
# ...
tests-done:
if: ${{ always() }}
needs:
- job_1
- job_2
- skippable_job_1
- skippable_job_2
runs-on: ubuntu-latest
steps:
- uses: matrix-org/done-action@v1
with:
needs: ${{ toJSON(needs) }}
skippable: |
skippable_job_1
skippable_job_2
Under needs
, you should list the names of the jobs that you want to complete
for the required status check to pass.
By default, the dependent jobs may not be skipped. Optionally, you can specify
the names of any jobs which may be skipped whilst still allowing the workflow to
pass, under steps...with.skippable
, one job per line.