A Github Action which suceeds only if all the dependent jobs succeeded
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-07-25 08:53:38 -07:00
dist Switch to TypeScript 2024-07-01 09:42:40 +02:00
.editorconfig Add an editorconfig and use 4 spaces indent 2024-07-08 13:45:18 +02:00
.gitignore Saner .gitignore 2022-03-04 15:04:29 +00:00
action.yml Make the action run on node20 2024-07-01 09:31:27 +02:00
CONTRIBUTING.md add DCO 2024-07-24 10:14:55 -07:00
index.ts Add an editorconfig and use 4 spaces indent 2024-07-08 13:45:18 +02:00
LICENSE Initial commit 2022-03-04 15:03:10 +00:00
package-lock.json Switch to TypeScript 2024-07-01 09:42:40 +02:00
package.json Switch to TypeScript 2024-07-01 09:42:40 +02:00
README.md Support for skippable jobs. 2022-03-04 15:36:28 +00:00
tsconfig.json Switch to TypeScript 2024-07-01 09:42:40 +02:00

done-action

A Github Action which suceeds only if all the dependent jobs succeeded.

Why?

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.

Usage

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.