From 9af2394e0a13c293b473f12cb1d76f7b3e38b318 Mon Sep 17 00:00:00 2001 From: Liang Wu Date: Tue, 1 Jul 2025 16:57:13 -0700 Subject: [PATCH] fix: continue the action when `grep -L` returns exit status 1 `grep -L` returns status 1 when there are modified files that don't have the `from __future__ import annotations` pattern. Previously if this happens, the entire GitHub action by default will stop and exit with status 1. Adding `|| true` will prevent this from happening and continue the workflow. PiperOrigin-RevId: 778246018 --- .github/workflows/check-file-contents.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-file-contents.yml b/.github/workflows/check-file-contents.yml index 780ff9f6..1f31ac07 100644 --- a/.github/workflows/check-file-contents.yml +++ b/.github/workflows/check-file-contents.yml @@ -70,7 +70,7 @@ jobs: # Use grep -L to find files that DO NOT contain the pattern. # This command will output a list of non-compliant files. - FILES_MISSING_IMPORT=$(grep -L 'from __future__ import annotations' $CHANGED_FILES) + FILES_MISSING_IMPORT=$(grep -L 'from __future__ import annotations' $CHANGED_FILES || true) # Check if the list of non-compliant files is empty if [ -z "$FILES_MISSING_IMPORT" ]; then