Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Documentation

- Coverage: document the required `Tests success` gate that `needs` the tests and the `coverage` call, so a skipped coverage job fails the gate instead of passing. Refs BehindTheMusicTree/github-config#97.

## [6.6.0] - 2026-11-25


Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,28 @@ The job fails when no report is found or when the reports hold no branch data. C

Report paths are resolved against the files tracked by the repository (exact path, the Cobertura `<source>` roots, or a unique suffix match), so the same file reported under several prefixes counts once. A report path that is a suffix of several tracked files, or a `.xml` file in a `coverage-*` artifact that is not a Cobertura report (invalid XML, or a root other than `<coverage>`), fails the job: emit repository-relative paths (`relative_files = true` in coverage.py) and upload only coverage reports.

A job that `needs` a test job is skipped when that job fails, and a skipped required check counts as passed. So `coverage` is not a required check itself: the caller's single required tests check (`Tests success`) is an `if: always()` gate that `needs` the test jobs **and** `coverage`, and fails when any of them is not successful. Call `coverage` without an `if`.

```yaml
jobs:
tests:
# ... uploads coverage-* artifacts
coverage:
needs: [tests]
uses: BehindTheMusicTree/github-workflows/.github/workflows/coverage.yml@<release-tag-or-commit>
tests-success:
name: Tests success
if: always()
needs: [tests, coverage]
runs-on: ubuntu-latest
steps:
- env:
NEEDS: ${{ toJSON(needs) }}
run: jq -e 'all(.[]; .result == "success")' <<<"$NEEDS"
```

Require `Tests success` only; the test jobs and `coverage` are declared optional in `BehindTheMusicTree/github-config`, which fails the repository when the gate does not need a job calling this workflow. A caller with a docs-only skip uses the scoped gate (`classify` job exposing `outputs.applicable`) described in that repository's README.

### Actionlint

Runs [actionlint](https://github.com/rhysd/actionlint) on the caller repo. Uses `.github/actionlint.yaml` from the caller if present, so repo-specific ignore rules (e.g. for reusable workflow calls) apply.
Expand Down