From 550e2803f04301a25900b448239718e2d332085d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mareks=20Ramp=C4=81ns?= <8796159+mr-git@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:23:04 +0300 Subject: [PATCH] add `all-green` job, which checks if all required jobs have succeeded; can be used for branch protection --- .github/workflows/ci.yml | 19 +++++++++++++++++++ README.md | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 027078c..167cac5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,3 +292,22 @@ jobs: - name: scaladoc ${{ matrix.scala }} run: sbt "++${{ matrix.scala }}; Compile/doc" + + # One status check to require in branch protection rules, instead of every matrix leg by name. + # See: https://github.com/re-actors/alls-green + all-green: + runs-on: ubuntu-latest + if: always() + needs: + - sbt-tasks + - test-coverage + - coverage-finished + - binary-compatibility + - formatting + - scaladoc + + steps: + - name: decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@b5b5b37504aa4183270bd3d855c52a67f212be35 # v1.3.0 + with: + jobs: ${{ toJSON(needs) }} diff --git a/README.md b/README.md index ff0ff7c..9bd3606 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,10 @@ to improve the quality of code in repo! * `formatting` - runs [scalafmt](https://scalameta.org/scalafmt/)'s `scalafmtCheckRepo` task (requires at least version 2.6.2) * `scaladoc` - calls `Compile/doc` task to make sure that Scaladocs compile +* `all-green` - a single check that passes only if all of the above did, via + [alls-green](https://github.com/re-actors/alls-green). Require it in branch protection rules as + `test / all-green` (named after the caller's job) rather than listing every matrix leg; callers no + longer need their own `all-green` job ### SonarQube Cloud