diff options
| author | Jay Kwak <82421531+jkwak-work@users.noreply.github.com> | 2025-08-09 08:26:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-09 15:26:07 +0000 |
| commit | 6d54b66ca633e1890fd4db4c6d90dfe90b9aa4fb (patch) | |
| tree | a8b95d6d9a6780e2b458b3f931644a8b551bf2fb | |
| parent | b7df3c7aa27301f88e31ed0a7bbf230688adab6a (diff) | |
Be conservative for checking if PR is doc changes only (#8130)
Fixes https://github.com/shader-slang/slang/issues/8098
| -rw-r--r-- | .github/workflows/ci.yml | 18 |
1 files changed, 13 insertions, 5 deletions
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 |
