({ env = process.env } = {})
| 310 | |
| 311 | // NON-BLOCKING. Always returns exit code 0; only emits `::warning` annotations. |
| 312 | function 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 | |
| 337 | function main(argv = process.argv.slice(2), env = process.env) { |
| 338 | const mode = (argv[0] || "readmes").toLowerCase(); |
no test coverage detected