Repository navigation
ci: actionlintを導入し、指摘されたワークフローの問題を修正する - #3156
Conversation
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]>
There was a problem hiding this comment.
🟢 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.
|
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
| # ubuntu-latestにはShellCheckが入っているので、run:のシェルスクリプトも検査される | ||
| - name: Check workflow files | ||
| run: | | ||
| curl -fLO --retry 3 --retry-delay 5 \ |
There was a problem hiding this comment.
actionlint、しばらくメンテナンスされていないっぽいのでjactionlintにしてください。
例えばubuntu-26.04がunknown runnerとして怒られるとかuses: $/の構文が使えないみたいなことが起きるはず...
あとダウンロードは可能ならvendored/下に追加するようにしてください。7zipのダウンロードがわかりやすいはず?
判断メモ:
- actionlint:GHAの(魅力的な)新機能に対応していなかったりやrunnerでfalse positiveが出たりするのは微妙、
- jactionlintは(miseの作者である)jdx氏なので経験者のメンテナンスではある
- 抜いてそこまで困ることはない(少なくともアプリ側には出ないし、これがないことで開発が悪化したりはしないはず)
There was a problem hiding this comment.
レビューありがとうございます!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]>
内容
GitHub Actions のワークフローを actionlint で検査するようにしました。
lintジョブに actionlint v1.7.12 を実行するステップを追加しました(voicevox_engine と同じく、ダウンロードしたファイルを sha256 で検証しています)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 のみなので、挙動は変わりません)確認したこと
$GITHUB_ENVと.envに書かれる内容が同じであることを確認code_signing == 'true'のときだけ実行)は手元では動かせないため、クォートとまとめ書きだけに留めています関連 Issue
ref #1039
スクリーンショット・動画など
なし
その他
tools/*.bashなどシェルスクリプトファイル自体に ShellCheck をかける CI は、署名用スクリプトの修正が必要になるため、別のプルリクエストにしたいと考えています。shellcheck ./build/*.shは、スクリプトがbuild/linux/に移動したため、今は何にもマッチしないようです。