Skip to content

Commit

Permalink
Merge pull request #65 from UlisesGascon/fix/last-relese
Browse files Browse the repository at this point in the history
fix: added 2.0.0-beta6 build
  • Loading branch information
KoolTheba authored Jun 8, 2023
2 parents d52f37a + 495847f commit 0af2f73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27756,6 +27756,7 @@ const generateScores = async ({ scope, database: currentDatabase, maxRequestInPa
if (storedScore) {
scoreData.prevScore = storedScore.score
scoreData.prevDate = storedScore.date
scoreData.prevCommit = storedScore.commit

if (storedScore.score !== score) {
scoreData.currentDiff = parseFloat((score - storedScore.score).toFixed(1))
Expand Down Expand Up @@ -27834,10 +27835,13 @@ const saveScore = ({ database, platform, org, repo, score, date, commit }) => {
repoRef.current = { score, date, commit }
}

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

Expand Down
4 changes: 2 additions & 2 deletions dist/issue.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Please review the following changes and take action if necessary.
There are changes in the following repositories:

<%_ if (scores.length) { -%>
| Repository | Commit | Score | Difference | Report Link | StepSecurity Link |
| Repository | Commit | Score | Score Delta | Report | StepSecurity |
| -- | -- | -- | -- | -- | -- |
<%_ } -%>
<%_ scores.forEach( score => { -%>
| [<%= score.org %>/<%= score.repo %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>) | [<%= score.commit.slice(0, 7) %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>/commit/<%= score.commit %>) | <% if (!renderBadge) { -%><%= score.score %> <%_ } -%> <%_ if (renderBadge) { -%> [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>/badge)](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>) <%_ } -%> | <%= score.currentDiff || 0 %> | [Full Report](<%= getReportUrl(score.org, score.repo, score.commit) %>) | [Fix it](https://app.stepsecurity.io/securerepo?repo=<%= score.org %>/<%= score.repo %>) |
| [<%= score.org %>/<%= score.repo %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>) | [<%= score.commit.slice(0, 7) %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>/commit/<%= score.commit %>) | <% if (!renderBadge) { -%><%= score.score %> <%_ } -%> <%_ if (renderBadge) { -%> [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>/badge)](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>) <%_ } -%> | <%= score.currentDiff || 0 %><%_ if (score.prevCommit) { -%> / [Details](<%= getReportUrl(score.org, score.repo, score.commit, score.prevCommit) %>)<%_ } -%> | [View](<%= getReportUrl(score.org, score.repo, score.commit) %>) | [Fix it](https://app.stepsecurity.io/securerepo?repo=<%= score.org %>/<%= score.repo %>) |
<%_ }); -%>
_Report generated by [UlisesGascon/openssf-scorecard-monitor](https://github.com/UlisesGascon/openssf-scorecard-monitor)._
4 changes: 2 additions & 2 deletions dist/report.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<%_ } -%>

<%_ if (scores.length) { -%>
| Repository | Commit | Score | Date | Difference | Report Link | StepSecurity Link |
| Repository | Commit | Score | Date | Score Delta | Report | StepSecurity |
| -- | -- | -- | -- | -- | -- | -- |
<%_ } -%>
<%_ scores.forEach( score => { -%>
| [<%= score.org %>/<%= score.repo %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>) | [<%= score.commit.slice(0, 7) %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>/commit/<%= score.commit %>) | <% if (!renderBadge) { -%><%= score.score %> <%_ } -%><% if (renderBadge) { -%> [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>/badge)](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>) <%_ } -%> | <%= score.date %> | <%= score.currentDiff || 0 %> | [Full Report](<%= getReportUrl(score.org, score.repo, score.commit) %>) | [Fix it](https://app.stepsecurity.io/securerepo?repo=<%= score.org %>/<%= score.repo %>) |
| [<%= score.org %>/<%= score.repo %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>) | [<%= score.commit.slice(0, 7) %>](https://<%= score.platform %>/<%= score.org %>/<%= score.repo %>/commit/<%= score.commit %>) | <% if (!renderBadge) { -%><%= score.score %> <%_ } -%><% if (renderBadge) { -%> [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>/badge)](https://api.securityscorecards.dev/projects/github.com/<%= score.org %>/<%= score.repo %>) <%_ } -%> | <%= score.date %> | <%= score.currentDiff || 0 %> <%_ if (score.prevCommit) { -%> / [Details](<%= getReportUrl(score.org, score.repo, score.commit, score.prevCommit) %>)<%_ } -%> | [View](<%= getReportUrl(score.org, score.repo, score.commit) %>) | [Fix it](https://app.stepsecurity.io/securerepo?repo=<%= score.org %>/<%= score.repo %>) |
<%_ }); -%>
_Report generated by [UlisesGascon/openssf-scorecard-monitor](https://github.com/UlisesGascon/openssf-scorecard-monitor)._

0 comments on commit 0af2f73

Please sign in to comment.