Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 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
c4dbadd
Bump the npm-dependencies group across 1 directory with 6 updates
dependabot[bot] Jan 12, 2026
b73d1f6
Initial plan
Copilot Jan 12, 2026
0307c61
Remove deprecated @types/glob and rebuild dist
Copilot Jan 12, 2026
130f5c0
Merge pull request #149 from advanced-security/copilot/sub-pr-148
felickz Jan 12, 2026
bbaabfd
Merge pull request #148 from advanced-security/dependabot/npm_and_yar…
felickz Jan 13, 2026
c2b8a66
Bump tar in /test in the npm_and_yarn group across 1 directory
dependabot[bot] Jan 16, 2026
ea95fe5
Merge pull request #150 from advanced-security/dependabot/npm_and_yar…
felickz Jan 16, 2026
489141f
Bump tar from 7.5.2 to 7.5.3
dependabot[bot] Jan 16, 2026
12d34de
Merge pull request #151 from advanced-security/dependabot/npm_and_yar…
felickz Jan 16, 2026
516a3ad
Bump the actions-dependencies group with 2 updates
dependabot[bot] Jan 19, 2026
026ce8b
Bump @babel/preset-env in the npm-dependencies group
dependabot[bot] Jan 19, 2026
7422d90
Merge pull request #153 from advanced-security/dependabot/npm_and_yar…
felickz Jan 19, 2026
386aa5c
Merge pull request #152 from advanced-security/dependabot/github_acti…
felickz Jan 19, 2026
6027851
Bump tar from 7.5.3 to 7.5.4
dependabot[bot] Jan 21, 2026
1a936f4
Bump tar in /test in the npm_and_yarn group across 1 directory
dependabot[bot] Jan 21, 2026
fe416ae
Merge pull request #154 from advanced-security/dependabot/npm_and_yar…
felickz Jan 21, 2026
9c110eb
Merge pull request #155 from advanced-security/dependabot/npm_and_yar…
felickz Jan 21, 2026
32fc958
Update component detection action version to 0.1.1
felickz Jan 21, 2026
7957361
Merge pull request #156 from advanced-security/latest-version-readme
felickz Jan 21, 2026
4407dda
Bump lodash in /test/nested in the npm_and_yarn group across 1 directory
dependabot[bot] Jan 22, 2026
65d132c
Merge pull request #157 from advanced-security/dependabot/npm_and_yar…
felickz Jan 23, 2026
fe72234
Bump tar from 7.5.4 to 7.5.6 in the npm-dependencies group
dependabot[bot] Jan 26, 2026
8270e9a
Merge pull request #158 from advanced-security/dependabot/npm_and_yar…
felickz Jan 26, 2026
f7f30e1
Bump tar in /test in the npm_and_yarn group across 1 directory
dependabot[bot] Jan 29, 2026
d041cfd
Revise README for workflows and detector options
felickz Jan 29, 2026
d177d78
Update README to remove duplication and version change
felickz Jan 29, 2026
cf04b7b
Bump the npm-dependencies group with 4 updates
dependabot[bot] Feb 2, 2026
1a45444
Initial plan
Copilot Feb 2, 2026
4f00d77
Fix ESM compatibility for @actions packages v3/v9
Copilot Feb 2, 2026
41bb53a
Update TypeScript config comments to be more concise
Copilot Feb 2, 2026
9aece0e
Merge pull request #163 from advanced-security/copilot/sub-pr-162
felickz Feb 2, 2026
9337616
Merge pull request #162 from advanced-security/dependabot/npm_and_yar…
felickz Feb 2, 2026
332c61a
Merge pull request #159 from advanced-security/dependabot/npm_and_yar…
felickz Feb 2, 2026
630165e
Merge pull request #161 from advanced-security/document-EnableIfDefau…
felickz Feb 2, 2026
80c6a54
Merge upstream:main
github-actions[bot] Feb 23, 2026
227b34d
Empty commit to open PR
github-actions[bot] Feb 23, 2026
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
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This GitHub Action runs the [microsoft/component-detection](https://github.com/microsoft/component-detection) library to automate dependency extraction at build time. It uses a combination of static and dynamic scanning to build a dependency tree and then uploads that to GitHub's dependency graph via the dependency submission API. This gives you more accurate Dependabot alerts, and support for a bunch of additional ecosystems.

### Example workflow
### Example workflows

```yaml

Expand All @@ -22,7 +22,34 @@ 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.1
```

Additional `Experimental` and `DefaultOff` detectors:
- For a list of experimental and default-off detectors that require explicit enablement, see the [Detectors README](https://github.com/microsoft/component-detection/blob/main/docs/detectors/README.md). See [enable-default-off.md](https://github.com/microsoft/component-detection/blob/main/docs/enable-default-off.md) for more details.

```yaml
name: Component Detection

on:
workflow_dispatch:
push:

permissions:
id-token: write
contents: write

jobs:
dependency-submission:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Component detection
uses: advanced-security/component-detection-dependency-submission-action@v0.1.1
with:
# Experimental detectors: Poetry, UvLock, NpmLockfile3, Ivy
# Default-off detectors: ConanLock, CondaLock, Dockerfile, Pip, SimplePip, Spdx22, SwiftResolved
detectorArgs: Poetry=EnableIfDefaultOff,UvLock=EnableIfDefaultOff,NpmLockfile3=EnableIfDefaultOff,Ivy=EnableIfDefaultOff,ConanLock=EnableIfDefaultOff,CondaLock=EnableIfDefaultOff,Dockerfile=EnableIfDefaultOff,Pip=EnableIfDefaultOff,SimplePip=EnableIfDefaultOff,Spdx22=EnableIfDefaultOff,SwiftResolved=EnableIfDefaultOff
```

### Configuration options
Expand All @@ -31,7 +58,7 @@ jobs:
| --- | --- | --- |
filePath | The path to the directory containing the environment files to upload. Defaults to Actions working directory. | `'.'`
directoryExclusionList | Filters out specific directories following a minimatch pattern. | `test`
detectorArgs | Comma separated list of properties that can affect the detectors execution, like EnableIfDefaultOff that allows a specific detector that is in beta to run, the format for this property is DetectorId=EnableIfDefaultOff, for example Pip=EnableIfDefaultOff. | `Pip=EnableIfDefaultOff`
detectorArgs | Comma separated list of properties that can affect the detectors execution, like EnableIfDefaultOff that allows a specific detector that is `Experimental` or `DefaultOff` to run, the format for this property is DetectorId=EnableIfDefaultOff, for example Pip=EnableIfDefaultOff. | `Pip=EnableIfDefaultOff`
dockerImagesToScan |Comma separated list of docker image names or hashes to execute container scanning on | ubuntu:16.04,56bab49eef2ef07505f6a1b0d5bd3a601dfc3c76ad4460f24c91d6fa298369ab |
detectorsFilter | A comma separated list with the identifiers of the specific detectors to be used. | `Pip, RustCrateDetector`
detectorsCategories | A comma separated list with the categories of components that are going to be scanned. The detectors that are going to run are the ones that belongs to the categories. | `NuGet,Npm`
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
5 changes: 3 additions & 2 deletions componentDetection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import tar from 'tar'
import fs from 'fs'
import * as exec from '@actions/exec';
import dotenv from 'dotenv'
import { Context } from '@actions/github/lib/context'
import { unmockedModulePathPatterns } from './jest.config'
import path from 'path';
dotenv.config();
Expand Down Expand Up @@ -154,7 +153,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
Loading