Skip to content

Commit ca300a6

Browse files
windschordclaude
andcommitted
fix: git diff失敗時にmutation-testジョブを明示的に失敗させる
|| trueを除去し、git diff失敗時はexit 1でジョブを停止する。 grepのフィルタリングのみ || true を許可(対象ファイルなしは正常)。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8cfcdb4 commit ca300a6

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,13 @@ jobs:
235235
id: changed-files
236236
run: |
237237
# PRのベースコミットとの差分から対象ファイルを取得(SHA指定で確実に動作)
238-
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR ${{ github.event.pull_request.base.sha }}...${{ github.sha }} -- \
239-
'src/services/**/*.ts' 'src/lib/**/*.ts' | \
240-
grep -v '__tests__' | \
241-
grep -v '\.test\.ts$' | \
242-
grep -v '\.spec\.ts$' || true)
238+
RAW_CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR ${{ github.event.pull_request.base.sha }}...${{ github.sha }} -- \
239+
'src/services/**/*.ts' 'src/lib/**/*.ts') || {
240+
echo "::error::git diff failed while collecting mutation targets"
241+
exit 1
242+
}
243+
CHANGED_FILES=$(printf '%s\n' "$RAW_CHANGED_FILES" | \
244+
grep -Ev '(__tests__|\.test\.ts$|\.spec\.ts$)' || true)
243245
244246
if [ -z "$CHANGED_FILES" ]; then
245247
echo "No mutation test target files changed"

0 commit comments

Comments
 (0)