Skip to content

Commit

Permalink
Run OpenSSF scorecard workflow and show badge (#10)
Browse files Browse the repository at this point in the history
* Run OpenSSF scorcard workflow

Run OpenSSF scorecard security checks on main branch. Results will be published
and available on the Scorecard project URL
https://scorecard.dev/viewer/?uri=github.com/uxlfoundation/oneapi-spec-site

* Add OpenSSF scorecard badge
  • Loading branch information
carlewis authored Jul 12, 2024
1 parent ea014cd commit cbb28aa
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Scorecards' GitHub action

name: Scorecard supply-chain security
on:
# For Branch-Protection check. Only the default branch is supported. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
branch_protection_rule:
schedule:
- cron: '12 10 * * 1'
push:
branches: [ "main" ]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: results.sarif
results_format: sarif
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with:
sarif_file: results.sarif
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ oneAPI Specification Web Site
.. image:: https://github.com/uxlfoundation/oneapi-spec-site/actions/workflows/publish.yaml/badge.svg
:target: https://github.com/uxlfoundation/oneapi-spec-site/actions/workflows/publish.yaml

.. image:: https://api.scorecard.dev/projects/github.com/uxlfoundation/oneapi-spec-site/badge
:target: https://scorecard.dev/viewer/?uri=github.com/uxlfoundation/oneapi-spec-site

This repository contains the source files for the oneAPI Specification web
site.

Expand Down

0 comments on commit cbb28aa

Please sign in to comment.