MCPcopy Create free account
hub / github.com/alibaba/open-code-review / runDocsCheck

Function runDocsCheck

scripts/github-actions/check-translation-sync.js:312–335  ·  view source on GitHub ↗
({ env = process.env } = {})

Source from the content-addressed store, hash-verified

310
311// NON-BLOCKING. Always returns exit code 0; only emits `::warning` annotations.
312function runDocsCheck({ env = process.env } = {}) {
313 const changed = getChangedFiles(env);
314 const warnings = findMissingTranslations(changed);
315 if (warnings.length === 0) {
316 console.log(
317 "Docs translation-sync check: no en-only documentation changes detected."
318 );
319 return 0;
320 }
321 for (const w of warnings) {
322 emitWarning(
323 w.enPath,
324 `Translation sync: ${w.enPath} changed but its ${w.locale} counterpart ` +
325 `${w.counterpart} was not updated in this PR. Update the translation ` +
326 `or note why it is intentionally out of sync.`
327 );
328 }
329 console.log(
330 `Docs translation-sync check: ${warnings.length} missing translation ` +
331 `counterpart(s) (non-blocking).`
332 );
333 writeStepSummary(env, warnings);
334 return 0;
335}
336
337function main(argv = process.argv.slice(2), env = process.env) {
338 const mode = (argv[0] || "readmes").toLowerCase();

Callers 1

mainFunction · 0.85

Calls 4

getChangedFilesFunction · 0.85
findMissingTranslationsFunction · 0.85
emitWarningFunction · 0.85
writeStepSummaryFunction · 0.85

Tested by

no test coverage detected