You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(ci): fail closed on shallow markdown diff (#1235) - #1238
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
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.
Summary
この PR は、changed Markdown 日本語チェックが shallow checkout で実質 no-op になっていた問題を、workflow だけで決定論的に解消するものです。
check-pr-bodyの checkout をfetch-depth: 0にして、shallow checkout 起因のno merge baseを防ぐようにしました。shell: bash+set -euo pipefail+git merge-base+git diff --name-only -zの fail-closed 実装へ置き換えました。.github/workflows/*の変更なので、.github/CLAUDE.mdに従って人間レビュー必須です。受け入れ条件の達成状況
Checkoutstep にfetch-depth: 0を追加しました。Check changed Markdown filesstep にshell: bashを追加しました。set -euo pipefailを設定しました。BASE_REFを使うgit fetch --no-tags --prune origin "+refs/heads/${BASE_REF}:refs/remotes/origin/${BASE_REF}"を追加しました。git merge-base "origin/${BASE_REF}" HEADを明示実行し、失敗時に fail するようにしました。git diff --name-only -z --diff-filter=ACMRT "$MERGE_BASE" HEAD -- '*.md'に置き換えました。No changed Markdown files to check.はCHANGED_MD配列長が 0 の場合だけ出力します。for file in "${CHANGED_MD[@]}"で反復し、Checking: <file>を出しつつ 1 件でも検証失敗したら step を非ゼロ終了します。検証コマンド結果
以下の issue VC 8 本をこの worktree で再実行し、すべて期待どおり PASS しました。
rg -n "fetch-depth: 0" .github/workflows/check-japanese.yml: PASS (29: fetch-depth: 0)rg -n "shell: bash" .github/workflows/check-japanese.yml: PASS (43: shell: bash)rg -n "set -euo pipefail" .github/workflows/check-japanese.yml: PASS (47: set -euo pipefail)rg -n "git fetch --no-tags --prune origin" .github/workflows/check-japanese.yml: PASS (49: git fetch --no-tags --prune origin "+refs/heads/${BASE_REF}:refs/remotes/origin/${BASE_REF}")rg -n 'git merge-base "origin/\$\{BASE_REF\}" HEAD' .github/workflows/check-japanese.yml: PASS (51: if ! MERGE_BASE="$(git merge-base "origin/${BASE_REF}" HEAD)"; then)rg -n 'git diff --name-only -z --diff-filter=ACMRT "\$MERGE_BASE" HEAD -- '\''\*\.md'\''' .github/workflows/check-japanese.yml: PASS (65: done < <(git diff --name-only -z --diff-filter=ACMRT "$MERGE_BASE" HEAD -- '*.md'))rg -n '"\$\{#CHANGED_MD\[@\]\}" -eq 0' .github/workflows/check-japanese.yml: PASS (67: if [ "${#CHANGED_MD[@]}" -eq 0 ]; then)rg -n 'for file in "\$\{CHANGED_MD\[@\]\}"' .github/workflows/check-japanese.yml: PASS (72: for file in "${CHANGED_MD[@]}"; do)Allowed Paths 遵守
.github/workflows/check-japanese.ymlのみです。git diff --name-onlyの結果は.github/workflows/check-japanese.ymlの 1 件だけでした。Checks
この section は、ローカルで完了した静的確認と、PR 作成後に GitHub Actions で追跡すべき deferred な確認先をまとめています。
deferredです。pull_request実行でChecking: <file>、No changed Markdown files to check.、merge-base 失敗時 fail-closed の挙動を確認する必要があります。.github/workflows/*変更のため、人間レビュー必須です。Schema Change Applicability
スキーマや契約のキー集合は変更しておらず、今回の差分は workflow 実装の fail-closed 化に限定されています。
Schema Consumer Inventory
この PR は consumer の追加や schema 変更を伴わず、既存 consumer の実行経路のうち workflow 側だけを修正しています。
Before
変更前は、workflow が shallow checkout 条件下で changed Markdown の差分計算に失敗しても、実質的に no-op pass していました。
After
変更後は、merge-base 前提確認と fail-closed な diff 収集により、changed Markdown があるときだけ確実に検査へ進みます。
.github/workflows/check-japanese.ymlcheck-pr-bodyjob の changed Markdown 検査を fail-closed 化validate_pr_body.pyvalidate_japanese_content.pySafety Claim Matrix
安全性に関わる workflow 変更なので、何をこの PR で制御し、何を PR CI 実行で追加確認するかを明示します。
fetch-depth: 0、git merge-base、AC1-AC5 の VC PASSset -euo pipefail、git diff --name-only -z、AC6-AC8 の VC PASSpull_requestコンテキストの実行ログはローカル未取得CI_TEST_PERFORMANCE_DECISION_V1
CI 変更としての影響範囲と、PR 作成時点で未充足の reviewer evidence をこの machine-readable block に残します。
Notes
この PR は issue contract の go snapshot に基づいて publish しており、runtime 証跡は Draft PR 上の CI 実行へ引き継ぎます。
.github/CLAUDE.mdに基づく)Check Japanese Contentworkflow 実行ログ