Skip to content

Commit

Permalink
Upgrades version to 0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
agustingroh committed Dec 18, 2024
1 parent 166bbbe commit f7f5381
Show file tree
Hide file tree
Showing 6 changed files with 212 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ For example workflow runs, check out our
| licenses.copyleft.exclude | List of Copyleft licenses to remove from default list. Provide licenses as a comma-separated list. | Optional | - |
| licenses.copyleft.explicit | Explicit list of Copyleft licenses to consider. Provide licenses as a comma-separated list. | Optional | - |
| runtimeContainer | Runtime URL | Optional | `ghcr.io/scanoss/scanoss-py:v1.15.0` |
| skipSnippets | Skip the generation of snippets. (scan_files option must be enabled) | Optional | `false` |
| skipSnippets | Skip the generation of snippets. (scanFiles option must be enabled) | Optional | `false` |
| scanFiles | Enable or disable file and snippet scanning | Optional | `true` |
| scanossSettings | Settings file to use for scanning. See the SCANOSS settings [documentation](https://scanoss.readthedocs.io/projects/scanoss-py/en/latest/#settings-file) | Optional | `true` |
| settingsFilepath | Filepath of the SCANOSS settings to be used for scanning | Optional | `scanoss.json` |
Expand Down
1 change: 0 additions & 1 deletion __tests__/data/test-results.json

This file was deleted.

6 changes: 3 additions & 3 deletions __tests__/undeclared-policy-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('UndeclaredPolicyCheck', () => {
scannerResults = JSON.parse(resultsMock[3].content);

undeclaredPolicyCheck = new UndeclaredPolicyCheck();
});
}, 30000);

it('should pass the policy check when undeclared components are not found', async () => {
const TEST_DIR = __dirname;
Expand All @@ -50,7 +50,7 @@ describe('UndeclaredPolicyCheck', () => {

await undeclaredPolicyCheck.run();
expect(undeclaredPolicyCheck.conclusion).toEqual(CONCLUSION.Success);
});
}, 30000);

it('should fail the policy check when undeclared components are found', async () => {
const TEST_DIR = __dirname;
Expand All @@ -63,5 +63,5 @@ describe('UndeclaredPolicyCheck', () => {

await undeclaredPolicyCheck.run();
expect(undeclaredPolicyCheck.conclusion).toEqual(CONCLUSION.Neutral);
});
}, 30000);
});
215 changes: 180 additions & 35 deletions dist/index.js

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

25 changes: 25 additions & 0 deletions policy-check-undeclared-results.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
5 undeclared component(s) were found.
Add the following snippet into your `sbom.json` file

```json
{
"components": [
{
"purl": "pkg:github/scanoss/wfp"
},
{
"purl": "pkg:github/scanoss/scanner.c"
},
{
"purl": "pkg:npm/%40grpc/grpc-js"
},
{
"purl": "pkg:npm/abort-controller"
},
{
"purl": "pkg:npm/adm-zip"
}
]
}
```

4 changes: 3 additions & 1 deletion src/services/scan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ export class ScanService {
private async detectSBOM(): Promise<string[]> {
// Overrides sbom file if is set
if (this.options.scanossSettings) {
core.debug(`[SCANOSS SETTINGS ENABLED] ${this.options.sbomFilepath}, ${this.options.sbomFilepath}`);
try {
await fs.promises.access(this.options.settingsFilePath, fs.constants.F_OK);
return ['--settings', this.options.settingsFilePath];
Expand All @@ -358,9 +359,10 @@ export class ScanService {
}

if (!this.options.sbomEnabled || !this.options.sbomFilepath) return [];

core.debug(`[SBOM ENABLED] ${this.options.sbomFilepath}, ${this.options.sbomFilepath}`);
try {
await fs.promises.access(this.options.sbomFilepath, fs.constants.F_OK);
core.debug(`[SBOM ENABLED] - Adding sbom to scan parameters`);
return [`--${this.options.sbomType?.toLowerCase()}`, this.options.sbomFilepath];
} catch (error: any) {
core.error(error.message);
Expand Down

0 comments on commit f7f5381

Please sign in to comment.