properly print instructions when the api reports don't match
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/repo-tools': patch
|
||||
---
|
||||
|
||||
Properly log instructions when APIs do not match
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user