@@ -47,13 +47,19 @@ class MavenDependencyGraph {
47
47
const artifact = this.packageUrlToArtifact[depPackage.packageURL.toString()];
48
48
let scope = getDependencyScopeForMavenScope(artifact.scopes);
49
49
manifest.addDirectDependency(depPackage, scope);
50
- function addTransitiveDeps(dependencies) {
50
+ function addTransitiveDeps(dependencies, seen = new Set() ) {
51
51
if (dependencies) {
52
52
dependencies.forEach(transitiveDep => {
53
- const transitiveDepArtifact = packageUrlToArtifact[transitiveDep.packageURL.toString()];
53
+ let purl = transitiveDep.packageURL.toString();
54
+ if (seen.has(purl)) {
55
+ // we're in a cycle! skip this one.
56
+ return;
57
+ }
58
+ const transitiveDepArtifact = packageUrlToArtifact[purl];
54
59
const transitiveDepScope = getDependencyScopeForMavenScope(transitiveDepArtifact.scopes);
55
60
manifest.addIndirectDependency(transitiveDep, transitiveDepScope);
56
- addTransitiveDeps(transitiveDep.dependencies);
61
+ seen.add(purl);
62
+ addTransitiveDeps(transitiveDep.dependencies, seen);
57
63
});
58
64
}
59
65
}
@@ -484,7 +490,7 @@ const depgraph_1 = __nccwpck_require__(8047);
484
490
const maven_runner_1 = __nccwpck_require__(7433);
485
491
const file_utils_1 = __nccwpck_require__(799);
486
492
const packageData = __nccwpck_require__(2876);
487
- const DEPGRAPH_MAVEN_PLUGIN_VERSION = '4.0.2 ';
493
+ const DEPGRAPH_MAVEN_PLUGIN_VERSION = '4.0.3 ';
488
494
function generateSnapshot(directory, mvnConfig, snapshotConfig) {
489
495
return __awaiter(this, void 0, void 0, function* () {
490
496
var _a, _b;
@@ -512,11 +518,11 @@ function generateSnapshot(directory, mvnConfig, snapshotConfig) {
512
518
snapshot.job.correlator = (snapshotConfig === null || snapshotConfig === void 0 ? void 0 : snapshotConfig.correlator)
513
519
? snapshotConfig.correlator
514
520
: (_b = snapshot.job) === null || _b === void 0 ? void 0 : _b.correlator;
515
- const specifiedRef = getNonEmtptyValue (snapshotConfig === null || snapshotConfig === void 0 ? void 0 : snapshotConfig.ref);
521
+ const specifiedRef = getNonEmptyValue (snapshotConfig === null || snapshotConfig === void 0 ? void 0 : snapshotConfig.ref);
516
522
if (specifiedRef) {
517
523
snapshot.ref = specifiedRef;
518
524
}
519
- const specifiedSha = getNonEmtptyValue (snapshot === null || snapshot === void 0 ? void 0 : snapshot.sha);
525
+ const specifiedSha = getNonEmptyValue (snapshot === null || snapshot === void 0 ? void 0 : snapshot.sha);
520
526
if (specifiedSha) {
521
527
snapshot.sha = specifiedSha;
522
528
}
@@ -616,7 +622,7 @@ function getRepositoryRelativePath(file) {
616
622
core.debug(`Snapshot relative file = ${result}`);
617
623
return result;
618
624
}
619
- function getNonEmtptyValue (str) {
625
+ function getNonEmptyValue (str) {
620
626
if (str) {
621
627
const trimmed = str.trim();
622
628
if (trimmed.length > 0) {
@@ -33295,7 +33301,7 @@ exports.submitSnapshot = L;
33295
33301
/***/ ((module) => {
33296
33302
33297
33303
"use strict";
33298
- module.exports = JSON.parse('{"name":"maven-dependency-submission-action","version":"4.1.1","description":"Submit Maven dependencies to GitHub dependency submission API","main":"index.js","scripts":{"base-build":"npm ci && tsc","build":"npm run base-build && npm exec -- @vercel/ncc build --source-map lib/src/index.js","build-exe":"npm run build && pkg package.json --compress Gzip","test":"vitest --run"},"repository":{"type":"git","url":"git+https://github.com/advanced-security/maven-dependency-submission-action.git"},"keywords":[],"author":"GitHub, Inc","license":"MIT","bugs":{"url":"https://github.com/advanced-security/maven-dependency-submission-action/issues"},"homepage":"https://github.com/advanced-security/maven-dependency-submission-action","dependencies":{"@actions/core":"^1.10.1","@actions/exec":"^1.1.1","@github/dependency-submission-toolkit":"^2.0.0","commander":"^12.0.0","packageurl-js":"^1.2.0"},"devDependencies":{"@types/chai":"^4.3.1","@vercel/ncc":"^0.38.1","chai":"^4.3.6","@yao-pkg/pkg":"^5.11.5","ts-node":"^10.9.2","typescript":"^5.3.3","vitest":"^1.2.1"},"bin":{"cli":"lib/src/executable/cli.js"},"pkg":{"targets":["node20-linux-x64","node20-win-x64","node20-macos-x64"],"assets":["package.json"],"publicPackages":"*","outputPath":"cli"}}');
33304
+ module.exports = JSON.parse('{"name":"maven-dependency-submission-action","version":"4.1.2","description":"Submit Maven dependencies to GitHub dependency submission API","main":"index.js","scripts":{"base-build":"npm ci && tsc","build":"npm run base-build && npm exec -- @vercel/ncc build --source-map lib/src/index.js","build-exe":"npm run build && pkg package.json --compress Gzip","test":"vitest --run"},"repository":{"type":"git","url":"git+https://github.com/advanced-security/maven-dependency-submission-action.git"},"keywords":[],"author":"GitHub, Inc","license":"MIT","bugs":{"url":"https://github.com/advanced-security/maven-dependency-submission-action/issues"},"homepage":"https://github.com/advanced-security/maven-dependency-submission-action","dependencies":{"@actions/core":"^1.10.1","@actions/exec":"^1.1.1","@github/dependency-submission-toolkit":"^2.0.0","commander":"^12.0.0","packageurl-js":"^1.2.0"},"devDependencies":{"@types/chai":"^4.3.1","@vercel/ncc":"^0.38.1","chai":"^4.3.6","@yao-pkg/pkg":"^5.11.5","ts-node":"^10.9.2","typescript":"^5.3.3","vitest":"^1.6.1"},"bin":{"cli":"lib/src/executable/cli.js"},"pkg":{"targets":["node20-linux-x64","node20-win-x64","node20-macos-x64"],"assets":["package.json"],"publicPackages":"*","outputPath":"cli"}}');
33299
33305
33300
33306
/***/ })
33301
33307
0 commit comments