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
7 changes: 3 additions & 4 deletions .github/workflows/ci-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ jobs:
echo "Applied org config: $CONFIG_FILE"
fi

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
# renovate: datasource=node-version depName=node
node-version: "26"
# node comes from the calling repository's .mise.toml — the single
# source of truth for tool versions, kept fresh by Renovate.
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- env:
GLOB: ${{ inputs.glob }}
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/ci-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,8 @@ jobs:

# Toolchain comes from the calling repository's .mise.toml — the single
# source of truth for node/pnpm versions, kept fresh by Renovate.
- uses: jdx/mise-action@3277a0f272901982804abc53abd93520db809be4 # v5.4.0
with:
# renovate: datasource=github-releases depName=jdx/mise
version: "2026.11.16"

- name: Resolve pnpm store path
id: pnpm-store
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"

- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ steps.pnpm-store.outputs.path }}
key: pnpm-store-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-${{ runner.os }}-
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- run: pnpm install --frozen-lockfile --ignore-scripts || { echo "::error::Lockfile out of date. Run 'pnpm install' locally and commit pnpm-lock.yaml"; exit 1; }
- run: pnpm run --if-present build
- run: pnpm run --if-present lint
- run: pnpm run --if-present typecheck
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/ci-opentofu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: CI (OpenTofu)

on:
workflow_call:
inputs:
opentofu-version:
description: OpenTofu version
type: string
default: "latest"

permissions:
contents: read
Expand All @@ -19,9 +14,9 @@ jobs:
with:
persist-credentials: false

- uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2
with:
tofu_version: ${{ inputs.opentofu-version }}
# opentofu comes from the calling repository's .mise.toml — the single
# source of truth for tool versions, kept fresh by Renovate.
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- run: tofu fmt -check -recursive
- run: tofu init -backend=false
Expand All @@ -34,7 +29,8 @@ jobs:
with:
persist-credentials: false

- uses: terraform-linters/setup-tflint@6ffdbaa3be476b3431f7275c26966ef32ff60337 # v6.3.2
# tflint comes from the calling repository's .mise.toml
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- run: tflint --init
- run: tflint --recursive
13 changes: 5 additions & 8 deletions .github/workflows/ci-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: CI (Terraform)
on:
workflow_call:
inputs:
terraform-version:
description: Terraform version
type: string
default: "latest"
working-directory:
description: Directory containing the Terraform configuration
type: string
Expand All @@ -26,9 +22,9 @@ jobs:
with:
persist-credentials: false

- uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4.0.1
with:
terraform_version: ${{ inputs.terraform-version }}
# terraform comes from the calling repository's .mise.toml — the single
# source of truth for tool versions, kept fresh by Renovate.
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- run: terraform fmt -check -recursive
- run: terraform init -backend=false
Expand All @@ -44,7 +40,8 @@ jobs:
with:
persist-credentials: false

- uses: terraform-linters/setup-tflint@6ffdbaa3be476b3431f7275c26966ef32ff60337 # v6.3.2
# tflint comes from the calling repository's .mise.toml
- uses: h13/.github/actions/setup-toolchain@146f7b04b4bfbfd7bf935a30879f2ac18dfc4a57 # v1.2.0

- run: tflint --init
- run: tflint --recursive
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ on:
- "profile/**"
- "sync/**"
- ".markdownlint-cli2.yaml"
- ".mise.toml"
pull_request:
paths:
- ".github/workflows/**"
- "actions/**"
- "profile/**"
- "sync/**"
- ".markdownlint-cli2.yaml"
- ".mise.toml"

permissions:
contents: read
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/publish-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@ jobs:
with:
persist-credentials: false

- uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1

- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
# Toolchain comes from the calling repository's .mise.toml — the single
# source of truth for node/pnpm versions, kept fresh by Renovate.
# mise-action is used directly instead of the setup-toolchain action:
# this job publishes with elevated credentials, so it must not restore
# caches (cache poisoning of a release path). No registry-url/.npmrc
# setup is needed — publishing authenticates via OIDC trusted
# publishing (id-token: write).
- uses: jdx/mise-action@3277a0f272901982804abc53abd93520db809be4 # v5.4.0
with:
# renovate: datasource=node-version depName=node
node-version: "26"
registry-url: https://registry.npmjs.org
# renovate: datasource=github-releases depName=jdx/mise
version: "2026.11.16"
cache: "false"

- run: pnpm install --frozen-lockfile
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm run build
- run: pnpm test
- run: pnpm publish --no-git-checks --access public --provenance
Expand Down
2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
node = "26.13.1"
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,34 @@ Default community health files, reusable workflows, and shared config for h13 re

Call from any repo via `uses: h13/.github/.github/workflows/<name>@<sha>`:

| Workflow | Stack | Inputs | Steps |
| ------------------ | --------- | ------------------------------------------------------------------------------------- | ------------------------------------------- |
| `ci-node.yml` | Node.js | `node-version` | npm ci (cached) → npm run lint → npm test |
| `ci-go.yml` | Go | — | go test -race → golangci-lint |
| `ci-php.yml` | PHP | `php-version`, `php-extensions`, `working-directory`, `composer-args`, `test-command` | composer install (cached) → composer test |
| `ci-terraform.yml` | Terraform | `terraform-version` | terraform fmt/init/validate → tflint |
| `ci-markdown.yml` | Markdown | `glob` | markdownlint-cli2 (org config auto-applied) |
| Workflow | Stack | Inputs | Steps |
| ------------------ | -------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------- |
| `ci-node.yml` | Node.js (pnpm) | — | pnpm install (cached) → build/lint/typecheck/test |
| `publish-node.yml` | Node.js (pnpm) | — | build → test → pnpm publish (OIDC provenance) |
| `ci-go.yml` | Go | — | go test -race → golangci-lint |
| `ci-php.yml` | PHP | `php-version`, `php-extensions`, `working-directory`, `composer-args`, `test-command` | composer install (cached) → composer test |
| `ci-terraform.yml` | Terraform | `working-directory` | terraform fmt/init/validate → tflint |
| `ci-opentofu.yml` | OpenTofu | — | tofu fmt/init/validate → tflint |
| `ci-markdown.yml` | Markdown | `glob` | markdownlint-cli2 (org config auto-applied) |
| `ci-zizmor.yml` | GitHub Actions | `min-severity` | zizmor static analysis of workflows |

All workflows enforce `permissions: { contents: read }` (least-privilege).

### Toolchain policy

Runtimes and CLIs come from the **calling repository's `.mise.toml`** via the
`setup-toolchain` action — one source of truth shared by local dev and CI,
kept fresh by Renovate. The exceptions are deliberate:

- **Go** (`ci-go.yml`): `actions/setup-go` reads the version from `go.mod` and
ships module/build caching that mise does not provide
- **PHP** (`ci-php.yml`): `shivammathur/setup-php` installs prebuilt binaries
and extensions; the mise PHP plugin compiles from source

Repositories calling the mise-based workflows (`ci-node`, `publish-node`,
`ci-terraform`, `ci-opentofu`, `ci-markdown`) must declare the required tools
(`node`/`pnpm`, `terraform`/`tflint`, `opentofu`/`tflint`, …) in `.mise.toml`.

### Example

```yaml
Expand Down