From 36a6a7503b5d007ca8fc9b0c0c4fe9b7f5095489 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Thu, 29 Aug 2024 04:44:06 +0000 Subject: [PATCH] Skip checking .po file if it's not edited on the current branch --- .github/workflows/code-quality.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml index 5ccc17219..ca4225458 100644 --- a/.github/workflows/code-quality.yaml +++ b/.github/workflows/code-quality.yaml @@ -59,6 +59,13 @@ jobs: linter_env = new.env() for (f in list.files('.ci/linters/po', full.names=TRUE)) sys.source(f, linter_env) for (po_file in list.files(pattern = "[.]po$", full.names=TRUE)) { + # only pay attention to files edited in the current PR, otherwise we can get + # a situation like after #6424 where some untranslated messages were added + # as part of non-translation maintenance, but this GHA would go red repeatedly + # until a translation is added or the blank/fuzzy translations removed. We'd + # rather only have the failure on one PR, then ignore these files later. + diff_v_master = system2("git", c("diff", "master", po_file), stdout=TRUE) + if (!length(diff_v_master)) next for (linter in ls(linter_env)) linter_env[[linter]](po_file) } shell: Rscript {0}