58 lines
2.1 KiB
YAML
58 lines
2.1 KiB
YAML
name: OSSF Scorecard
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
schedule:
|
|
- cron: "43 6 * * 5" # weekly at 06:43 (UTC) on Friday
|
|
workflow_dispatch:
|
|
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
analysis:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
# Needed for Code scanning upload
|
|
security-events: write
|
|
# Needed for GitHub OIDC token if publish_results is true
|
|
id-token: write
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2.1.1
|
|
id: create-token
|
|
with:
|
|
# analyzing classic branch protections requires a token with admin read permissions
|
|
# see https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
|
|
# and https://github.com/open-telemetry/community/issues/2769
|
|
app-id: ${{ vars.OSSF_SCORECARD_APP_ID }}
|
|
private-key: ${{ secrets.OSSF_SCORECARD_PRIVATE_KEY }}
|
|
|
|
- uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
|
with:
|
|
repo_token: ${{ steps.create-token.outputs.token }}
|
|
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.
|
|
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
|
|
- name: "Upload artifact"
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
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@df559355d593797519d70b90fc8edd5db049e7a2 # v3.29.9
|
|
with:
|
|
sarif_file: results.sarif
|