Skip to content

Commit 9af2394

Browse files
wuliang229copybara-github
authored andcommitted
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
1 parent 873beca commit 9af2394

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/check-file-contents.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
7171
# Use grep -L to find files that DO NOT contain the pattern.
7272
# This command will output a list of non-compliant files.
73-
FILES_MISSING_IMPORT=$(grep -L 'from __future__ import annotations' $CHANGED_FILES)
73+
FILES_MISSING_IMPORT=$(grep -L 'from __future__ import annotations' $CHANGED_FILES || true)
7474
7575
# Check if the list of non-compliant files is empty
7676
if [ -z "$FILES_MISSING_IMPORT" ]; then

0 commit comments

Comments
 (0)