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

Function runDocsCheck

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

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 4

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

Tested by

no test coverage detected