Skip to content

Commit

Permalink
SP-70 Updates readme
Browse files Browse the repository at this point in the history
  • Loading branch information
francostramana committed Mar 25, 2024
1 parent 017341f commit 4dc7b0f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
![CI](https://github.com/scanoss/code-scan-action/actions/workflows/ci.yml/badge.svg)
[![Check dist/](https://github.com/scanoss/code-scan-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/scanoss/scanoss-code-scan-step/actions/workflows/check-dist.yml)
[![CodeQL](https://github.com/scanoss/code-scan-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/scanoss/scanoss-code-scan-step/actions/workflows/codeql-analysis.yml)
![Coverage](./badges/coverage.svg)

The SCANOSS Code Scan Action enhances your software development process by automatically scanning your code for security
vulnerabilities and license compliance with configurable policies.
Expand Down Expand Up @@ -43,7 +44,7 @@ jobs:

- name: Run SCANOSS Code Scan
id: scanoss-code-scan-step
uses: scanoss/code-scan-action@main
uses: scanoss/code-scan-action@v0
```
For example workflow runs, check out our
Expand Down Expand Up @@ -117,7 +118,7 @@ jobs:
- name: Run SCANOSS Code Scan
id: scanoss-code-scan-step
uses: scanoss/code-scan-action@main
uses: scanoss/code-scan-action@v0
with:
policies: copyleft, undeclared #NOTE: undeclared policy requires a sbom.json in the project root
dependencies.enabled: true
Expand Down
8 changes: 4 additions & 4 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const runMock = jest.spyOn(main, 'run');
let debugMock: jest.SpyInstance;
let errorMock: jest.SpyInstance;
let getInputMock: jest.SpyInstance;
let setFailedMock: jest.SpyInstance;
let setOutputMock: jest.SpyInstance;
// let setFailedMock: jest.SpyInstance;
// let setOutputMock: jest.SpyInstance;

describe('action', () => {
beforeEach(() => {
Expand All @@ -26,8 +26,8 @@ describe('action', () => {
debugMock = jest.spyOn(core, 'debug').mockImplementation();
errorMock = jest.spyOn(core, 'error').mockImplementation();
getInputMock = jest.spyOn(core, 'getInput').mockImplementation();
setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation();
setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation();
// setFailedMock = jest.spyOn(core, 'setFailed').mockImplementation();
// setOutputMock = jest.spyOn(core, 'setOutput').mockImplementation();
});

it('SCANOSS Scan Action started', async () => {
Expand Down
4 changes: 2 additions & 2 deletions __tests__/undeclared-policy-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ describe('UndeclaredPolicyCheck', () => {
});

it('should pass the policy check when undeclared components are not found', async () => {
jest.spyOn(sbomUtils, 'parseSBOM').mockImplementation(async _ => Promise.resolve(sbomMock[1]));
jest.spyOn(sbomUtils, 'parseSBOM').mockImplementation(async () => Promise.resolve(sbomMock[1]));

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

it('should fail the policy check when undeclared components are found', async () => {
jest.spyOn(sbomUtils, 'parseSBOM').mockImplementation(async _ => Promise.resolve(sbomMock[0]));
jest.spyOn(sbomUtils, 'parseSBOM').mockImplementation(async () => Promise.resolve(sbomMock[0]));

await undeclaredPolicyCheck.run(scannerResults);
expect(undeclaredPolicyCheck.conclusion).toEqual(CONCLUSION.Neutral);
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 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 src/policies/policy-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export abstract class PolicyCheck {
core.debug(`Finish policy check: ${this.checkName}. (conclusion=${this._conclusion})`);
this._status = STATUS.FINISHED;

const result = await this.octokit.rest.checks.update({
await this.octokit.rest.checks.update({
owner: context.repo.owner,
repo: context.repo.repo,
check_run_id: this.checkRunId,
Expand Down

0 comments on commit 4dc7b0f

Please sign in to comment.