mirror of
https://github.com/imjasonh/apidiff-action
synced 2026-07-06 22:52:43 +00:00
Fix apidiff export path handling
Use relative paths when creating export files in subdirectories
This commit is contained in:
parent
d05e5461cf
commit
99351e17cb
1 changed files with 8 additions and 6 deletions
|
|
@ -21,17 +21,19 @@ async function runApidiff({ workingDirectory, oldRef, newRef }) {
|
|||
|
||||
if (isDirectory) {
|
||||
// For directories, we need to create export files first
|
||||
const oldExportPath = path.join(workingDirectory, oldRef, 'apidiff.export');
|
||||
const newExportPath = path.join(workingDirectory, newRef, 'apidiff.export');
|
||||
const oldDir = path.join(workingDirectory, oldRef);
|
||||
const newDir = path.join(workingDirectory, newRef);
|
||||
const oldExportPath = path.join(oldDir, 'apidiff.export');
|
||||
const newExportPath = path.join(newDir, 'apidiff.export');
|
||||
|
||||
// Create export for old version
|
||||
await exec.exec('apidiff', ['-w', oldExportPath, '.'], {
|
||||
cwd: path.join(workingDirectory, oldRef)
|
||||
await exec.exec('apidiff', ['-w', 'apidiff.export', '.'], {
|
||||
cwd: oldDir
|
||||
});
|
||||
|
||||
// Create export for new version
|
||||
await exec.exec('apidiff', ['-w', newExportPath, '.'], {
|
||||
cwd: path.join(workingDirectory, newRef)
|
||||
await exec.exec('apidiff', ['-w', 'apidiff.export', '.'], {
|
||||
cwd: newDir
|
||||
});
|
||||
|
||||
// Now compare the export files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue