Repository navigation
60 lines (51 loc) · 1.77 KB
/
Copy pathscorecard.yml
File metadata and controls
60 lines (51 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Scorecard
# OpenSSF Scorecard: scans the repository weekly and on pushes to the default
# branch, publishes the result to the public Scorecard API, and uploads the
# SARIF to code scanning. Scorecard's publishing rules constrain this file (no
# top-level env or defaults, no containers, only its approved actions, and a
# GitHub-hosted Ubuntu runner), so keep it as small as the upstream example.
on:
branch_protection_rule:
schedule:
- cron: '26 11 * * 6'
push:
branches: [main]
workflow_dispatch:
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
# Code scanning upload.
security-events: write
# GitHub OIDC token, needed by publish_results.
id-token: write
contents: read
actions: read
steps:
- name: Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code scanning
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with:
sarif_file: results.sarif