Skip to content

ci: add shared gha-lint, dependency-review and nix-lint workflows - #9

Merged
furedea merged 6 commits into
mainfrom
ci/add-shared-lint-workflows
Nov 7, 2026
Merged

furedea merged 6 commits into
mainfrom
ci/add-shared-lint-workflows

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

概要

gha-lint,dependency-review,nix-lint を reusable workflow として追加し,この repo の ci.yml から呼んで all-green の needs に入れる.各 repo の個別ファイルは,この workflow を呼ぶ形へ順次置き換える(#6 のステップ 1).

変更内容

  • gha-lint.yml: actionlint と zizmor.任意の入力 workflow-template-dir(既定は空)を指定すると,そのディレクトリの *.yml も検査する
  • dependency-review.yml: 常に動く判定ジョブで,pull_request かつ公開 repo のときだけ review する.入力 fail-on-severity の既定は high.設定ファイルは使わない
  • nix-lint.yml: nixfmt,statix,deadnix(手順は現行と同じ)
  • ci.yml: 3 つを ./.github/workflows/... で呼び,all-green の needs に block 形式で追加
  • gha_lint.yml,dependency_review.yml,.github/dependency_review_config.yml を削除
  • codeql.yml: analyze ジョブに if: ${{ !github.event.repository.private }} を追加し,pin を更新
  • .ls-lint.yml: 新しいハイフン名を許可
  • README.md: 3 workflow の節と呼び出し例を追加

固定した版

checkout v7.0.1,actionlint v2.2.0,zizmor v0.8.1,dependency-review-action v5.0.0,install-nix-action v31.11.3,codeql-action v4.39.2(すべて full SHA)

確認すること

  • 3 つの新ジョブが success
  • main への push では,dependency-review の中身が skipped でも呼び出し側と all-green が success

Refs #6

🤖 Generated with Claude Code

Add reusable gha-lint.yml, dependency-review.yml and nix-lint.yml, call
them from ci.yml and gate all-green on them. Remove the per-repository
gha_lint.yml, dependency_review.yml and its config file. Skip codeql on
private repositories and bump its pins. Allow the new names in ls-lint
and document the workflows in the README.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T05:07:35.676347Z 435e318 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Review summary

No blocking findings.

What I checked:

  • ci.yml / all-green: the three new reusable workflows are called locally and added to needs. In dependency-review.yml, the should-review job always succeeds and only the inner review job is skipped. So on a push to main the caller job should still succeed, and all-green's skipped check won't trip.
  • dependency-review.yml: github.event_name and github.event.repository.private come from the caller's context, so the gating is correct. Removing the config file and passing fail-on-severity directly keeps the old behaviour (high, and failing rather than only warning is the action's default).
  • gha-lint.yml: workflow-template-dir reaches the shell through env, so it can't inject commands. When the input is empty, files is empty and actionlint's default discovery is unchanged. Neither workflow keeps the old paths filter, so both now run on every PR, which is fine.
  • nix-lint.yml: the steps are the same as the old inline job.
  • codeql.yml: for schedule events, !github.event.repository.private evaluates !null, which is true, so scheduled analysis still runs.

Not verified (I had no network access while reviewing): that the pinned SHAs match the tags in their comments, and that zizmor finds workflows under the staged .zizmor-templates/.github/workflows directory. The second only matters for callers that set workflow-template-dir, and this repo's CI doesn't use that input, so this PR's checks won't exercise it.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2895d625cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/gha-lint.yml Outdated
fail-on-error: true
shellcheck: true
pyflakes: true
files: ${{ inputs.workflow-template-dir != '' && format('.github/workflows/*.yml,{0}/*.yml', inputs.workflow-template-dir) || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve .yaml workflows in the actionlint file list

When a caller sets workflow-template-dir, this explicit files value replaces actionlint's automatic repository discovery but includes only .github/workflows/*.yml. Consequently, valid .github/workflows/*.yaml files are silently excluded from actionlint, including its shellcheck and pyflakes checks. The action wrapper documents files as replacement glob patterns, while actionlint normally discovers every repository workflow when no paths are supplied; include both supported extensions in the custom list.

Useful? React with 👍 / 👎.

Comment on lines +62 to +64
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
with:
advanced-security: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass staged templates to zizmor explicitly

When workflow-template-dir is set, the preceding step copies its files beneath .zizmor-templates/.github/workflows, but this invocation leaves zizmor's input at its default .. The action documents that default input, and zizmor's directory-collection rules exclude nested .github/workflows directories when . is a Git repository root because those files are not active repository workflows. Thus the staged templates are never security-audited; pass the staging directory or files through the action's inputs option.

Useful? React with 👍 / 👎.

…s in zizmor

Run actionlint and zizmor on the template directory in their own steps so
the default discovery of .github/workflows (including .yaml files) is kept
and the staged templates are passed to zizmor explicitly. Ignore zizmor's
self-repository finding for ci.yml, which calls local reusable workflows
with ./ on purpose.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@codex review

with:
advanced-security: false

- name: Stage workflow templates for discovery

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The workflow-template-dir path is never exercised. This repo's ci.yml calls gha-lint.yml without the input, so the second actionlint run, this staging step and the second zizmor run are all skipped in CI here. Any breakage only shows up in a downstream caller, for example zizmor's directory discovery for .zizmor-templates/.github/workflows or cp failing when the directory has no *.yml files. A small fixture directory (for example .github/test-templates/sample.yml) plus a second caller job that sets workflow-template-dir would cover it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixture と専用ジョブは入れないことにしました.workflow-template-dir の経路は,dotfiles への展開時にその repo の CI(実際の templates/*.yml)で確かめます.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Review summary

No blocking findings (P0: 0, P1: 0).

What I checked:

  • dependency-review.yml uses the same always-succeeding gate job as claude-review.yml. On push to main, review is skipped but the caller job still succeeds, so all-green's skipped check will not trip. The github.event.* context comes from the caller, so the public/private check is correct.
  • Moving nix-lint into a reusable workflow keeps the same steps. Only the pins changed.
  • Each job's permissions are minimal, and the caller grants match what the called workflows need (actions: read for zizmor).
  • The codeql.yml private-repo guard and the .ls-lint.yml patterns match the new file names.

Findings:

  • P3 gha-lint.yml: the workflow-template-dir branch (template actionlint, staging step, template zizmor run) is never run in this repo's CI, so it is untested. See the inline comment.

Note: removing the old path filters means gha-lint now runs on every PR and push. That looks intended.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: bc86d233f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Add a sample template and a second gha-lint caller job that sets
workflow-template-dir, so the template actionlint, staging and zizmor
steps run in this repository's CI. Gate all-green on the new job.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Review summary: no findings.

Checked:

  • dependency-review.yml: should-review always succeeds and its output is compared as the string 'true', so on push/private runs the caller job (and all-green) still reports success while review is skipped.
  • gha-lint.yml: workflow-template-dir reaches the shell only through env (no expression injection); the template steps are gated on a non-empty input, and the .github/test-templates fixture in ci.yml exercises that path.
  • ci.yml: all new callers are in all-green needs, and the old path-filtered gha_lint.yml and dependency_review.yml triggers are now covered by CI's push: main and pull_request triggers. Nothing still references the deleted config file.
  • codeql.yml: the private guard still evaluates as true for schedule events, which have no repository payload, so the weekly scan still runs.

Not verified: I couldn't read the PR's check results from this environment, so confirm the new jobs are green (in particular that zizmor accepts the self-repository rule key in .github/zizmor.yml).

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8099ce8863

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

furedea and others added 2 commits November 7, 2026 03:43
Remove the sample template and the gha-lint-templates job; the
workflow-template-dir path is verified when rolling out to dotfiles.
Replace .github/zizmor.yml with inline zizmor: ignore[self-repository]
comments on the local reusable workflow calls in ci.yml. Add a README
section that separates shared workflows from those for this repository.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Use $/.github/workflows/... instead of ./.github/workflows/... in ci.yml
and drop the zizmor ignore comments, which are no longer needed.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 6, 2026

Copy link
Copy Markdown
Owner

@codex review

Comment thread .github/workflows/ci.yml Outdated
runs-on: ubuntu-latest
timeout-minutes: 10
gha-lint:
uses: $/.github/workflows/gha-lint.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 — uses: $/.github/workflows/gha-lint.yml is not a valid reusable-workflow reference. A local reusable workflow has to start with ./. The same $/ prefix appears on all five uses: lines (lines 21, 27, 32, 37, 45), including the claude-review and codex-review lines, which used to be ./. GitHub will reject the whole ci.yml as an invalid workflow, so no job runs and all-green never reports. That blocks every PR, and this PR's own checklist can't pass. It looks like a broken substitution of ./.

Suggested change
uses: $/.github/workflows/gha-lint.yml
uses: ./.github/workflows/gha-lint.yml

(Apply the same fix to the dependency-review, nix-lint, claude-review and codex-review lines.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci.yml の 5 行を ./ に戻し,各行に # zizmor: ignore[self-repository] を付けました.$/ は GitHub では有効ですが,actionlint が未対応(rhysd/actionlint#711)のため,対応後に $/ へ切り替えて抑制を外します.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #10.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Review summary

1 blocking finding (P0)

  • P0 .github/workflows/ci.yml: all five uses: lines (gha-lint, dependency-review, nix-lint, claude-review, codex-review) start with $/.github/workflows/... instead of ./.github/workflows/.... That is not a valid local reusable-workflow reference, so GitHub will reject ci.yml and all-green will never report. The two review jobs were already working with ./ and this PR breaks them too. Changing $/ to ./ fixes it.

The new reusable workflows themselves look fine:

  • gha-lint.yml: the template staging for zizmor and the actionlint files glob are fine.
  • dependency-review.yml: the always-succeeding decision job does what the PR says.
  • nix-lint.yml: same steps as before.
  • codeql.yml: the private guard is fine.

No other findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8c9b59eeb9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml Outdated
runs-on: ubuntu-latest
timeout-minutes: 10
gha-lint:
uses: $/.github/workflows/gha-lint.yml

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep self-references compatible with actionlint

Although GitHub accepts the new $/ syntax, the Run actionlint step in gha-lint.yml invokes the Raven wrapper with fail-on-error: true and no version or ignore override. The wrapper therefore downloads the latest actionlint release, while actionlint's open support issue confirms that it does not yet recognize $/ references. Consequently, scanning ci.yml reports this and the other self-references as invalid, causing gha-lint and then all-green to fail on every push and pull request; retain ./ references with the zizmor suppressions or configure actionlint appropriately until support is released.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご指摘のとおり,ci.yml の 5 行を ./ に戻し,各行に # zizmor: ignore[self-repository] を付けました.actionlint の $/ 対応(rhysd/actionlint#711)後に $/ へ切り替えて抑制を外します.

actionlint does not support the $/ self-repository syntax yet
(rhysd/actionlint#711), so gha-lint failed on ci.yml. Go back to
./.github/workflows/... and suppress zizmor's self-repository audit on
each call until actionlint supports $/.

Refs #6

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 7, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Review summary: I found no P0–P3 issues.

What I checked:

  • The new reusable workflows (gha-lint, dependency-review, nix-lint) keep the old checks' behavior and SHA pinning, and every job sets the least permissions it needs.
  • dependency-review uses the same always-succeeding should-review pattern as claude-review. A push to main skips the inner review, but the caller and all-green still succeed.
  • The workflow-template-dir input never reaches a shell directly. It goes into with: or through an env var (TEMPLATE_DIR), so it can't be used for script injection.
  • ci.yml adds all three callers to all-green's needs, and .ls-lint.yml allows the new hyphenated file names.

Things to know:

  • These workflows have no automated tests. The PR's own CI run is the only check that they work.
  • Dropping private repositories from dependency-review and CodeQL is a deliberate change: the old dependency_review.yml also ran on private repositories.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 435e318cdb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit afd2703 into main Nov 7, 2026
12 checks passed
@furedea
furedea deleted the ci/add-shared-lint-workflows branch November 7, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant