Skip to content

ci: actionlintを導入し、指摘されたワークフローの問題を修正する - #3156

Merged
sevenc-nanashi merged 2 commits into
VOICEVOX:mainfrom
b84330808:add-actionlint
Oct 18, 2026
Merged

sevenc-nanashi merged 2 commits into
VOICEVOX:mainfrom
b84330808:add-actionlint

Conversation

@b84330808

@b84330808 b84330808 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

内容

GitHub Actions のワークフローを actionlint で検査するようにしました。

  • lint ジョブに actionlint v1.7.12 を実行するステップを追加しました(voicevox_engine と同じく、ダウンロードしたファイルを sha256 で検証しています)
  • ubuntu-latest には ShellCheck 0.9.0 が入っているので、run: 内のシェルスクリプトも検査されます

導入時点で出ていた 44 件の指摘を修正しました。

  • build.yml:存在しない matrix.product_name と、今はない vue.config.js を参照していたコメントアウト行を削除(run: 内ではコメントの中の ${{ }} も評価されるため、actionlint がエラーにします)
  • $GITHUB_ENV・$GITHUB_OUTPUT・$patch などをダブルクォートで囲む(SC2086、SC2046)
  • $GITHUB_ENV への連続した書き込みを { ...; } >> "$GITHUB_ENV" にまとめる(SC2129)
  • [[ ${{ matrix.os }} == ubuntu-* ]] を [[ "$RUNNER_OS" == "Linux" ]] に変更(SC2193。matrix の OS は ubuntu / macos / windows-latest のみなので、挙動は変わりません)

確認したこと

  • actionlint 1.7.12 で、ShellCheck 0.9.0(CI と同じ)と 0.11.0 のどちらでも、変更前 44 件 → 変更後 0 件
  • 書き換えたシェル部分は、ダミーの値で変更前後の両方を実行し、$GITHUB_ENV と .env に書かれる内容が同じであることを確認
  • CI で使う linux_amd64 の tar.gz を実際にダウンロードし、sha256 の検証が通ることを確認
  • コード署名のステップ(code_signing == 'true' のときだけ実行)は手元では動かせないため、クォートとまとめ書きだけに留めています

関連 Issue

ref #1039

スクリーンショット・動画など

なし

その他

  • tools/*.bash などシェルスクリプトファイル自体に ShellCheck をかける CI は、署名用スクリプトの修正が必要になるため、別のプルリクエストにしたいと考えています。
  • README の「Shellcheck」の節にある shellcheck ./build/*.sh は、スクリプトが build/linux/ に移動したため、今は何にもマッチしないようです。
  • Claude Code を使って作業し、内容は私が確認しました。

lintジョブでactionlint v1.7.12(sha256検証付き)を実行する。
ubuntu-latestにはShellCheckが入っているので、run:のスクリプトも検査される。

actionlintとShellCheckの指摘44件を修正する。
- 存在しないmatrix.product_nameとvue.config.jsを参照していたコメント行を削除
- $GITHUB_ENV・$GITHUB_OUTPUTなどの変数をクォート
- $GITHUB_ENVへの連続した書き込みを { ...; } >> "$GITHUB_ENV" にまとめる
- matrix.osのパターン比較を$RUNNER_OSでの比較に置き換え

ref VOICEVOX#1039

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The checksum was verified, and the focused workflow changes have no identified blocking issues.

0 open findings

What changed in this PR

Adds actionlint to CI to catch GitHub Actions workflow errors and resolves existing lint warnings.

Changes:

  • Downloads and verifies actionlint before running workflow checks.
  • Fixes shell quoting, groups environment-file writes, and simplifies Linux detection.
  • Removes an obsolete commented-out build command.
File Description
.github/​workflows/​test.yml Adds actionlint and fixes shell warnings.
.github/​workflows/​build.yml Fixes quoting and environment writes; removes an obsolete comment.
.github/​workflows/​build_preview_pages.yml Quotes build output paths.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@voicevox-preview-pages

voicevox-preview-pages Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:ae66ff4

Comment thread .github/workflows/test.yml Outdated
# ubuntu-latestにはShellCheckが入っているので、run:のシェルスクリプトも検査される
- name: Check workflow files
run: |
curl -fLO --retry 3 --retry-delay 5 \

@sevenc-nanashi sevenc-nanashi Oct 16, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

actionlint、しばらくメンテナンスされていないっぽいのでjactionlintにしてください。
例えばubuntu-26.04がunknown runnerとして怒られるとかuses: $/の構文が使えないみたいなことが起きるはず...

あとダウンロードは可能ならvendored/下に追加するようにしてください。7zipのダウンロードがわかりやすいはず?

判断メモ:

  • actionlint:GHAの(魅力的な)新機能に対応していなかったりやrunnerでfalse positiveが出たりするのは微妙、
  • jactionlintは(miseの作者である)jdx氏なので経験者のメンテナンスではある
  • 抜いてそこまで困ることはない(少なくともアプリ側には出ないし、これがないことで開発が悪化したりはしないはず)

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.

レビューありがとうございます!jactionlint に切り替えました(ae66ff4)。

  • tools/downloadJactionlint.ts で vendored/jactionlint/ にダウンロードするようにしました。download7z.ts と同じ形で sha256 を検証し、Windows では vendored の 7z で展開しています
  • pnpm run jactionlint で実行でき、CI の lint ジョブもこれを使います
  • .github/jactionlint.yaml で profile: correctness(actionlint と同じ範囲)にしています。default プロファイルにするとセキュリティ・ポリシー系の指摘が 62 件出るので、そちらは別途検討できればと思います
  • jactionlint は composite action もチェックするので、download-engine と setup-environment の 49 件の指摘も修正しました。download-engine は変更前後をダミーの curl・7z で動かし、展開結果や $GITHUB_ENV・$GITHUB_OUTPUT が同じになることを確認しています
  • README に使い方を追記しました

手元(Windows、Node 24.11.1)では、postinstall:download-scripts、pnpm run jactionlint(ShellCheck 0.9.0 / 0.11.0 とも指摘 0 件)、typecheck、typos、markdownlint が通っています。

レビューの指摘に合わせて、メンテナンスが続いているjactionlintに切り替える。

- tools/downloadJactionlint.tsでvendored/jactionlintにダウンロードする(7zやtyposと同じ方式で、sha256を検証する)
- pnpm run jactionlintで実行し、CIのlintジョブも同じコマンドを使う
- .github/jactionlint.yamlでactionlintと同じ範囲のcorrectnessプロファイルを指定する
- READMEに使い方を追加

jactionlintはcomposite actionもチェックするので、download-engineとsetup-environmentで指摘された49件も修正する。

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sevenc-nanashi sevenc-nanashi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

特に問題なさそう。ありがとうございます。

@sevenc-nanashi
sevenc-nanashi added this pull request to the merge queue Oct 18, 2026
Merged via the queue into VOICEVOX:main with commit 933997f Oct 18, 2026
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.

3 participants