Skip to content

Commit

Permalink
chore: refactor to use new OSSF Scorecard visualizer URL (#78)
Browse files Browse the repository at this point in the history
Signed-off-by: Ulises Gascón <ulisesgascongonzalez@gmail.com>
  • Loading branch information
UlisesGascon authored Jun 10, 2024
1 parent 01de350 commit 059d0f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ If you would like to contribute to the documentation, please feel free to open a

- Easy to use with great customization
- Easy to patch the scoring as the reports includes a direct link to [StepSecurity](https://app.stepsecurity.io)
- Easy way to visualize the scorecard results with [The Scorecard Visualizer](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/nodejs/node) or [deps.dev](https://deps.dev/project/github/nodejs%2Fnode)
- Cutting-edge feature that effortlessly compares OpenSSF scorecards between previous and current commits with [The Scorecard Visualizer Comparator](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/nodejs/node/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/19fa9f1bc47b0666be0747583bea8cb3d8ad5eb1)
- Easy way to visualize the scorecard results with [The Scorecard Visualizer](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/nodejs/node) or [deps.dev](https://deps.dev/project/github/nodejs%2Fnode)
- Cutting-edge feature that effortlessly compares OpenSSF scorecards between previous and current commits with [The Scorecard Visualizer Comparator](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/nodejs/node/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/19fa9f1bc47b0666be0747583bea8cb3d8ad5eb1)
- Discovery mode: list all the repos in one or many organizations that are already being tracked with [OpenSSF Scorecard](https://github.com/ossf/scorecard)
- Reporting in Markdown with essential information (hash, date, score) and comparative against the prior score
- Self-hosted: The reporting data is stored in JSON format (including previous records) in the repo itself
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
- `report-start-tag` Defines the start tag, default `<!-- OPENSSF-SCORECARD-MONITOR:START -->`
- `report-end-tag`: Defines the closing tag, default `<!-- OPENSSF-SCORECARD-MONITOR:END -->`
- `render-badge`: Defines if the OpenSSF badge must be rendered in the reportor to only show the score
- `report-tool`: Defines the reporting review tool in place: `scorecard-visualizer` [Example](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/nodejs/node) or `deps.dev` [Example](https://deps.dev/project/github/nodejs%2Fnode), by default `scorecard-visualizer`
- `report-tool`: Defines the reporting review tool in place: `scorecard-visualizer` [Example](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/nodejs/node) or `deps.dev` [Example](https://deps.dev/project/github/nodejs%2Fnode), by default `scorecard-visualizer`

### Outputs

Expand Down
6 changes: 3 additions & 3 deletions __tests__/__snapshots__/utils.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports[`Utils generateReportContent Should render template with scorecard-visua
| Repository | Commit | Score | Date | Score Delta | Report | StepSecurity |
| -- | -- | -- | -- | -- | -- | -- |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo/badge)](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo) | 2023-02-20 | 5 / [Details](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo/badge)](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo) | 2023-02-20 | 5 / [Details](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
_Report generated by [ossf/scorecard-monitor](https://github.com/ossf/scorecard-monitor)._"
`;
Expand All @@ -31,7 +31,7 @@ exports[`Utils generateReportContent Should render template with scores and titl
| Repository | Commit | Score | Date | Score Delta | Report | StepSecurity |
| -- | -- | -- | -- | -- | -- | -- |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | 10 | 2023-02-20 | 5 / [Details](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | 10 | 2023-02-20 | 5 / [Details](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
_Report generated by [ossf/scorecard-monitor](https://github.com/ossf/scorecard-monitor)._"
`;
Expand All @@ -43,7 +43,7 @@ exports[`Utils generateReportContent Should render template with scores only 1`]
| Repository | Commit | Score | Date | Score Delta | Report | StepSecurity |
| -- | -- | -- | -- | -- | -- | -- |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo/badge)](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo) | 2023-02-20 | 5 / [Details](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
| [fake-org/fake-repo](https://github.com/fake-org/fake-repo) | [846b3dd](https://github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo/badge)](https://api.securityscorecards.dev/projects/github.com/fake-org/fake-repo) | 2023-02-20 | 5 / [Details](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/compare/39a08ee8b8d3818677eb823cb566f36b1b1c4671/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [View](https://ossf.github.io/scorecard-visualizer/#/projects/github.com/fake-org/fake-repo/commit/846b3ddb5f75d95235e94d9eb52e920f4a067338) | [Fix it](https://app.stepsecurity.io/securerepo?repo=fake-org/fake-repo) |
_Report generated by [ossf/scorecard-monitor](https://github.com/ossf/scorecard-monitor)._"
`;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ const saveScore = ({ database, platform, org, repo, score, date, commit }) => {

const generateReportUrl = reportTool => (org, repo, commit, prevCommit) => {
if (reportTool === 'scorecard-visualizer' && !prevCommit) {
return `https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/${org}/${repo}/commit/${commit}`
return `https://ossf.github.io/scorecard-visualizer/#/projects/github.com/${org}/${repo}/commit/${commit}`
}
if (reportTool === 'scorecard-visualizer' && prevCommit) {
return `https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/${org}/${repo}/compare/${prevCommit}/${commit}`
return `https://ossf.github.io/scorecard-visualizer/#/projects/github.com/${org}/${repo}/compare/${prevCommit}/${commit}`
}
return `https://deps.dev/project/github/${org.toLowerCase()}%2F${repo.toLowerCase()}`
}
Expand Down

0 comments on commit 059d0f8

Please sign in to comment.