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