diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 3b47994..a2b50ca 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -47,6 +47,10 @@ "actions/sticky-comment": { "component": "sticky-comment", "initial-version": "0.0.1" + }, + "actions/repo-health": { + "component": "repo-health", + "initial-version": "0.0.1" } }, "plugins": [ diff --git a/.github/release-please-manifest.json b/.github/release-please-manifest.json index 5a1db07..ed0d575 100644 --- a/.github/release-please-manifest.json +++ b/.github/release-please-manifest.json @@ -5,5 +5,6 @@ "actions/stale": "0.0.2", "actions/runs-on-selector": "0.0.1", "actions/terragrunt/report": "0.0.1", - "actions/sticky-comment": "0.0.1" + "actions/sticky-comment": "0.0.1", + "actions/repo-health": "0.0.0" } diff --git a/actions/repo-health/README.md b/actions/repo-health/README.md new file mode 100644 index 0000000..16c3e97 --- /dev/null +++ b/actions/repo-health/README.md @@ -0,0 +1,80 @@ +# repo-health + +Fails unless the repository keeps the practices every repository is expected to +keep. Every check is on by default. The only way past one is to set that +check's own `-skip` input to the reason, so a repository that does not +meet a practice says so in its workflow rather than by leaving the check out. + +## Usage + +```yaml +name: Repo health + +on: + pull_request: + schedule: + - cron: '0 9 1 * *' # monthly, so a repository that has not changed is still checked + workflow_dispatch: + +permissions: {} + +jobs: + repo-health: + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: read + steps: + - uses: actions/checkout@ # vX.Y.Z + with: + persist-credentials: false + + - uses: TrogonStack/github-actions/actions/repo-health@ # vX.Y.Z +``` + +The workflow decides when it runs. The action only reads the checkout, so it +gives the same answer however often it is called. + +### Skipping a check + +```yaml + - uses: TrogonStack/github-actions/actions/repo-health@ # vX.Y.Z + with: + citation-cff-skip: internal tooling, nothing to cite +``` + +## Checks + +| Check | Passes when | +| --- | --- | +| `citation-cff` | `CITATION.cff` sits at the repository root under that exact name, with the top-level keys CFF 1.2.0 requires: `cff-version`, `message`, `title`, `authors`. | + +## Inputs + +| Input | Default | Description | +| --- | --- | --- | +| `directory` | `github.workspace` | Root of the checked-out repository. | +| `citation-cff-skip` | empty | Reason to skip `citation-cff`. Empty runs it. | + +## Outputs + +| Output | Description | +| --- | --- | +| `failed` | JSON array of the checks that failed and were not skipped. | + +## Fixed behaviour + +These are not inputs, on purpose. + +- Every check runs unless skipped. A check added in a later version applies to + every consumer as they upgrade, which is the point of keeping them here. +- Each check has its own inputs, named `-