Failed to build the changes

This commit is contained in:
Peter Murray
2022-10-25 17:41:18 +00:00
committed by GitHub
parent dbbec38f94
commit a5e48b32cd
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -306,7 +306,9 @@ function generateSnapshot(directory, context, job) {
const depgraph = yield generateDependencyGraph(directory);
try {
const mavenDependencies = new depgraph_1.MavenDependencyGraph(depgraph);
const manifest = mavenDependencies.createManifest(path.join(directory, 'pom.xml'));
// The filepath to the POM needs to be relative to the root of the GitHub repository for the links to work once uploaded
const pomFile = getRepositoryRelativePath(path.join(directory, 'pom.xml'));
const manifest = mavenDependencies.createManifest(pomFile);
const snapshot = new dependency_submission_toolkit_1.Snapshot(getDetector(), context, job);
snapshot.addManifest(manifest);
return snapshot;
@@ -396,6 +398,17 @@ function checkForMultiModule(reactorJsonFile) {
throw new Error(`Failed to load file ${reactorJsonFile}: ${err}`);
}
}
// TODO this is assuming the checkout was made into the base path of the workspace...
function getRepositoryRelativePath(file) {
const workspaceDirectory = path.resolve(process.env.GITHUB_WORKSPACE || '.');
const fileResolved = path.dirname(path.resolve(file));
if (fileResolved.startsWith(workspaceDirectory)) {
return fileResolved.substring(workspaceDirectory.length + path.sep.length);
}
else {
return path.resolve(file);
}
}
//# sourceMappingURL=snapshot-generator.js.map
/***/ }),
+1 -1
View File
File diff suppressed because one or more lines are too long