Skip to content

Commit e944c44

Browse files
Skip checking .po file if it's not edited on the current branch
1 parent eb29893 commit e944c44

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/code-quality.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ jobs:
5959
linter_env = new.env()
6060
for (f in list.files('.ci/linters/po', full.names=TRUE)) sys.source(f, linter_env)
6161
for (po_file in list.files(pattern = "[.]po$", full.names=TRUE)) {
62+
# only pay attention to files edited in the current PR, otherwise we can get
63+
# a situation like after #6424 where some untranslated messages were added
64+
# as part of non-translation maintenance, but this GHA would go red repeatedly
65+
# until a translation is added or the blank/fuzzy translations removed. We'd
66+
# rather only have the failure on one PR, then ignore these files later.
67+
diff_v_master = system2("git", c("diff", "master", po_file), stdout=TRUE)
68+
if (!length(diff_v_master)) next
6269
for (linter in ls(linter_env)) linter_env[[linter]](po_file)
6370
}
6471
shell: Rscript {0}

0 commit comments

Comments
 (0)