セキュリティチェックが起動できない問題を直す - #7
Merged
Merged
Conversation
解説文の中にテンプレート式の記法をリテラルで書いていたため、 Actions がそれを式として評価しようとして構文エラーになり、 ワークフロー全体が起動できていなかった(ジョブが1つも作られず failure)。 リテラル表記をやめ、日本語の説明に置き換える。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GitHub 公式(actions/*)と自社(CALIL/*)はタグ指定を許容し、 第三者のアクションはコミットSHA固定を必須とする方針を .github/zizmor.yml に書き下す。 これまでは zizmor の既定に任せており、zizmor 側の既定が変わると 各リポジトリのチェックが一斉に落ちる状態だった。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
症状
Actionsのセキュリティチェックが、導入直後の実行から 一度も動いていません。実行画面には
This run likely failed because of a workflow file issue.と出て、ジョブが1つも作られないまま failure になっています。
原因
ワークフローの解説文(ヘッダのコメントと、失敗時の案内テーブル)の中に、
template-injectionの直し方を説明するためのテンプレート式の記法をリテラルで書いていました。
Actions はワークフローを読み込む段階でファイル中のテンプレート式を評価するため、
この「中身が空の式」を構文エラーと判定し、ワークフロー全体の起動に失敗していました。
シェル側のエスケープ(
\)は Actions の評価には効きません。直し方
リテラル表記をやめ、「テンプレート式を
run:に直書きせずenv:経由で渡す」という日本語の説明に置き換えます。伝わる内容は同じです。
同じ罠を踏まないよう、ファイル冒頭に注意書きも入れます。
確認
このPRは
.github/**を変更するのでチェック自身が走ります。このPRのチェックが成功すれば、起動できるようになったことの証明になります
(これまでは起動すらできていませんでした)。