Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
601c613
Update README to have latest version
GeekMasher Aug 15, 2025
c7cb2bb
Merge pull request #131 from advanced-security/GeekMasher-patch-1
GeekMasher Aug 25, 2025
ec00348
Unescape the locationsFoundAt paths
lxop Oct 23, 2025
d434719
Update dist
lxop Oct 24, 2025
9b429e3
Add test
lxop Oct 27, 2025
3517f8f
Bump brace-expansion from 1.1.11 to 1.1.12
dependabot[bot] Nov 14, 2025
eb91e65
Bump js-yaml from 3.14.1 to 3.14.2
dependabot[bot] Nov 17, 2025
caf2b08
Bump js-yaml in /test in the npm_and_yarn group across 1 directory
dependabot[bot] Nov 17, 2025
376d625
Merge pull request #141 from advanced-security/dependabot/npm_and_yar…
aegilops Nov 20, 2025
f59e294
Merge pull request #142 from advanced-security/dependabot/npm_and_yar…
aegilops Nov 20, 2025
333866a
Merge pull request #140 from advanced-security/dependabot/npm_and_yar…
aegilops Nov 20, 2025
6ca39f3
Bump the npm-dependencies group across 1 directory with 13 updates
dependabot[bot] Nov 20, 2025
98ddec4
Bump the actions-dependencies group across 1 directory with 3 updates
dependabot[bot] Nov 24, 2025
7dde1e2
Merge pull request #137 from lxop/unescape-locationsfoundat
aegilops Nov 26, 2025
d93866d
Merge pull request #138 from advanced-security/dependabot/github_acti…
aegilops Nov 26, 2025
51ff88a
Merge pull request #139 from advanced-security/dependabot/npm_and_yar…
aegilops Nov 26, 2025
aafc767
Merge upstream:main
github-actions[bot] Dec 15, 2025
b132dbb
Empty commit to open PR
github-actions[bot] Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Component detection
uses: advanced-security/component-detection-dependency-submission-action@v0.0.3
uses: advanced-security/component-detection-dependency-submission-action@v0.1.0
```

### Configuration options
Expand Down
38 changes: 38 additions & 0 deletions componentDetection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,44 @@ describe("ComponentDetection.processComponentsToManifests", () => {
expect(manifests[0].indirectDependencies()).toHaveLength(1);
expect(manifests[0].countDependencies()).toBe(1);
});

test("un-escapes URL-encoded locationsFoundAt", () => {
const componentsFound = [
{
component: {
name: "test-package",
version: "1.0.0",
packageUrl: {
Scheme: "pkg",
Type: "nuget",
Name: "test-package",
Version: "1.0.0"
},
id: "test-package 1.0.0 - nuget"
},
isDevelopmentDependency: false,
topLevelReferrers: [], // Empty = direct dependency
locationsFoundAt: ["/my%20project/my%20project.csproj"]
}
];

const dependencyGraphs: DependencyGraphs = {
"my project/my project.csproj": {
graph: { "test-package": null },
explicitlyReferencedComponentIds: ["test-package 1.0.0 - nuget"],
developmentDependencies: [],
dependencies: []
}
};

const manifests = ComponentDetection.processComponentsToManifests(componentsFound, dependencyGraphs);

expect(manifests).toHaveLength(1);
expect(manifests[0].name).toBe("my project/my project.csproj");
expect(manifests[0].directDependencies()).toHaveLength(1);
expect(manifests[0].indirectDependencies()).toHaveLength(0);
expect(manifests[0].countDependencies()).toBe(1);
});
});

describe('normalizeDependencyGraphPaths', () => {
Expand Down
4 changes: 3 additions & 1 deletion componentDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export default class ComponentDetection {
packages.forEach((pkg: ComponentDetectionPackage) => {
pkg.locationsFoundAt.forEach((location: any) => {
// Use the normalized path (remove leading slash if present)
const normalizedLocation = location.startsWith('/') ? location.substring(1) : location;
let normalizedLocation = location.startsWith('/') ? location.substring(1) : location;
// Unescape the path, as upstream ComponentDetection emits locationsFoundAt in URL-encoded form
normalizedLocation = decodeURIComponent(normalizedLocation);

if (!manifests.find((manifest: Manifest) => manifest.name == normalizedLocation)) {
const manifest = new Manifest(normalizedLocation, normalizedLocation);
Expand Down
4 changes: 3 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading