Skip to content
24 changes: 23 additions & 1 deletion scorecards-site/static/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,21 @@
</a>
</div>
</div>
<div class="content"><small class="fw-semibold">API URL:</small>
{{#if data.repo.name}}
{{#if data.repo.commit}}
<a class="btn-link" href="https://api.scorecard.dev/{{data.repo.name}}?commit={{data.repo.commit}}" target="_blank" rel="noopener noreferrer">
https://api.scorecard.dev/{{data.repo.name}}
</a>
{{else}}
<a class="btn-link" href="https://api.scorecard.dev/{{data.repo.name}}" target="_blank" rel="noopener noreferrer">
https://api.scorecard.dev/{{data.repo.name}}
</a>
{{/if}}
{{else}}
<span class="text-muted">-</span>
{{/if}}
</div>
<div class="content text-truncate"><small class="fw-semibold">COMMIT:</small>
{{#if data.repo.commit}}
<span class="d-none d-sm-inline-block text-muted">{{data.repo.commit}}</span>
Expand All @@ -865,6 +880,13 @@
<span class="text-muted">-</span>
{{/if}}
</div>
<div class="content"><small class="fw-semibold">SCORECARD VERSION:</small>
{{#if data.scorecard.version}}
<span class="text-muted">{{data.scorecard.version}}</span>
{{else}}
<span class="text-muted">-</span>
{{/if}}
</div>
</div>
<div class="d-none d-md-inline-block select-wrapper">
<div class="d-flex flex-row align-items-center">
Expand Down Expand Up @@ -1295,7 +1317,7 @@
}

async function apiFetch(platform, org, repo, commit) {
const response = await fetch(`https://api.securityscorecards.dev/projects/${platform}/${org}/${repo}${commit ? `?commit=${commit}` : ''}`);
const response = await fetch(`https://api.scorecard.dev/projects/${platform}/${org}/${repo}${commit ? `?commit=${commit}` : ''}`);
if (response.ok) {
const data = await response.json();
return data;
Expand Down