diff --git a/.changeset/five-turkeys-taste.md b/.changeset/five-turkeys-taste.md new file mode 100644 index 0000000000..7f3361ebbf --- /dev/null +++ b/.changeset/five-turkeys-taste.md @@ -0,0 +1,5 @@ +--- +'@backstage/repo-tools': patch +--- + +Properly log instructions when APIs do not match diff --git a/packages/repo-tools/src/commands/api-reports/api-extractor.ts b/packages/repo-tools/src/commands/api-reports/api-extractor.ts index 70b4e54739..90c5c40fdd 100644 --- a/packages/repo-tools/src/commands/api-reports/api-extractor.ts +++ b/packages/repo-tools/src/commands/api-reports/api-extractor.ts @@ -519,14 +519,17 @@ export async function runApiExtraction({ if (message.text.includes('The API report file is missing')) { shouldLogInstructions = true; } + + // Detect messages like the following being output by the generator: + // Warning: You have changed the API signature for this project. Please copy the file "/home/runner/work/backstage/backstage/node_modules/.cache/api-extractor/backend-test-utils/report.api.md" to "report.api.md", or perform a local build (which does this automatically). See the Git repo documentation for more info. if ( message.text.includes( - 'You have changed the public API signature for this project.', + 'You have changed the API signature for this project.', ) ) { shouldLogInstructions = true; const match = message.text.match( - /Please copy the file "(.*)" to "api-report\.api\.md"/, + /Please copy the file "(.*)" to "report\.api\.md"/, ); if (match) { conflictingFile = match[1];