From ebdab9e700e31d56dd920e9fa615985d182e764e Mon Sep 17 00:00:00 2001 From: Hironori Takahashi Date: Wed, 2 Dec 2026 10:34:52 +0900 Subject: [PATCH] feat: share actionlint as a reusable workflow - New ci-actionlint.yml (workflow_call) so consumer repos can lint their workflows the same way this repo does; SHA-pinned rhysd/actionlint. - ci.yml dogfoods it and drops its path filters: the jobs are cheap, the checks become required by the main branch ruleset (a filtered-out required check blocks merges as "Expected"), and test-markdown lints files the old filter did not cover (README.md). - README: workflow table + architecture diagram. --- .github/workflows/ci-actionlint.yml | 17 +++++++++++++++ .github/workflows/ci.yml | 32 +++++------------------------ README.md | 21 ++++++++++--------- 3 files changed, 33 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/ci-actionlint.yml diff --git a/.github/workflows/ci-actionlint.yml b/.github/workflows/ci-actionlint.yml new file mode 100644 index 0000000..0705edc --- /dev/null +++ b/.github/workflows/ci-actionlint.yml @@ -0,0 +1,17 @@ +name: CI (actionlint) + +on: + workflow_call: {} + +permissions: + contents: read + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ca3ef4..e99067b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,13 @@ name: CI +# No path filters: the jobs are cheap, the checks are required by the main +# branch ruleset (a filtered-out required check would block the merge as +# "Expected"), and test-markdown lints files (README.md, ...) that the old +# filter did not cover. on: push: branches: [main] - paths: - - ".github/workflows/**" - - "actions/**" - - "profile/**" - - "sync/**" - - ".markdownlint-cli2.yaml" - - ".mise.toml" - - "mise.lock" - - ".mise/**" - - "workflow-templates/**" pull_request: - paths: - - ".github/workflows/**" - - "actions/**" - - "profile/**" - - "sync/**" - - ".markdownlint-cli2.yaml" - - ".mise.toml" - - "mise.lock" - - ".mise/**" - - "workflow-templates/**" permissions: contents: read @@ -34,13 +18,7 @@ concurrency: jobs: actionlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: rhysd/actionlint@914e7df21a07ef503a81201c76d2b11c789d3fca # v1.7.12 + uses: ./.github/workflows/ci-actionlint.yml test-markdown: uses: ./.github/workflows/ci-markdown.yml diff --git a/README.md b/README.md index 953a946..6f6483b 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,16 @@ Default community health files, reusable workflows, and shared config for h13 re Call from any repo via `uses: h13/.github/.github/workflows/@`: -| 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-opentofu.yml` | OpenTofu | `working-directory` | 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 | +| 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-opentofu.yml` | OpenTofu | `working-directory` | 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 | +| `ci-actionlint.yml` | GitHub Actions | — | actionlint syntax/expression check of workflows | All workflows enforce `permissions: { contents: read }` (least-privilege). @@ -97,7 +98,7 @@ h13/dotfiles ← Dev environment + repo-init └─ configures → GitHub settings (branch protection, labels, alerts) h13/.github ← Reusable Workflows + shared config ★ - ├─ ci-{node,go,php,opentofu,markdown,zizmor}.yml (reusable, SHA-pinned) + ├─ ci-{node,go,php,opentofu,markdown,zizmor,actionlint}.yml (reusable, SHA-pinned) ├─ compliance-audit.yml (monthly) ├─ repo-sync.yml (dynamic sync to all repos) └─ setup-toolchain action