|
32 | 32 | import * as fs from "node:fs"; |
33 | 33 | import * as util from "node:util"; |
34 | 34 |
|
| 35 | +import { parseAllChangeFiles } from "./changes/changes.ts"; |
35 | 36 | import { |
36 | 37 | addPrLabels, |
37 | 38 | closePr, |
@@ -96,6 +97,15 @@ pnpm run changes:add |
96 | 97 | > Not every PR needs a change file — you can skip this step if the change is internal-only |
97 | 98 | > (tests, tooling, docs)`; |
98 | 99 |
|
| 100 | +const CHANGE_FILE_INVALID_COMMENT = `${CHANGE_FILE_MARKER} |
| 101 | +### ❌ Invalid Change Files |
| 102 | +
|
| 103 | +One or more change files are invalid. Run the following command locally for details: |
| 104 | +
|
| 105 | +\`\`\`sh |
| 106 | +pnpm changes:validate |
| 107 | +\`\`\``; |
| 108 | + |
99 | 109 | const CLOSE_FEATURE_PR_COMMENT = `\ |
100 | 110 | To align with our new [Open Governance](https://remix.run/blog/rr-governance) model, we are now asking that all new features go through the [Proposal/RFC process](https://github.com/remix-run/react-router/blob/main/GOVERNANCE.md#new-feature-process) and that we don't open PRs until a proposal has been accepted and advanced to Stage 1. |
101 | 111 |
|
@@ -274,6 +284,22 @@ async function changeFileCheck(ctx: CheckContext): Promise<CheckResult> { |
274 | 284 | let body = CHANGE_FILE_MISSING_COMMENT; |
275 | 285 |
|
276 | 286 | if (summaries.length > 0) { |
| 287 | + let { valid } = parseAllChangeFiles(); |
| 288 | + if (!valid) { |
| 289 | + console.log("changeFileCheck: invalid change files found"); |
| 290 | + return { |
| 291 | + actions: [ |
| 292 | + { |
| 293 | + type: "upsert-sticky-comment", |
| 294 | + marker: CHANGE_FILE_MARKER, |
| 295 | + body: CHANGE_FILE_INVALID_COMMENT, |
| 296 | + }, |
| 297 | + ], |
| 298 | + failureMessage: |
| 299 | + "Change file validation failed - please run `pnpm changes:validate` locally for details", |
| 300 | + }; |
| 301 | + } |
| 302 | + |
277 | 303 | body = [ |
278 | 304 | CHANGE_FILE_FOUND_COMMENT, |
279 | 305 | "| Type | Change |", |
|
0 commit comments