From 6d54b66ca633e1890fd4db4c6d90dfe90b9aa4fb Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Sat, 9 Aug 2025 08:26:07 -0700 Subject: Be conservative for checking if PR is doc changes only (#8130) Fixes https://github.com/shader-slang/slang/issues/8098 --- .github/workflows/ci.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb88df01b..225677f1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,13 +114,21 @@ jobs: else BASE=HEAD^1 fi - if git diff --name-only -z $BASE...HEAD | - grep --null-data -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then - echo "should-run=true" >> $GITHUB_OUTPUT + + shouldRun=true + if files="$(git diff --name-only $BASE...HEAD)"; then + # Git diff succeeded, check if non-documentation files were changed + if echo "$files" | grep -qvE '^(docs/|LICENSES/|LICENSE$|CONTRIBUTING\.md$|README\.md$)'; then + shouldRun=true + else + echo "Only documentation files changed, skipping remaining steps" + shouldRun=false + fi else - echo "Only documentation files changed, skipping remaining steps" - echo "should-run=false" >> $GITHUB_OUTPUT + echo "Git diff failed, conservatively running tests" + shouldRun=true fi + echo "should-run=$shouldRun" >> $GITHUB_OUTPUT - name: Install dependencies run: | if [[ "${{ matrix.os }}" = "linux" ]]; then -- cgit v1.2.3