Repository navigation
65 lines (54 loc) · 2.17 KB
/
Copy pathscorecard.yml
File metadata and controls
65 lines (54 loc) · 2.17 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
61
62
63
64
65
name: OpenSSF Scorecard
on:
# Fires whenever branch protection rules change — one of the three canonical
# Scorecard triggers; lets the score update immediately after policy changes.
branch_protection_rule:
# Weekly scan — Sunday 02:47 UTC (off-peak; spread from codeql's Tuesday slot)
schedule:
- cron: '47 2 * * 0'
# Score every push to the default branch so the badge reflects current state.
push:
branches:
- main
# Least-privilege default; the analysis job adds only what it needs.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
# One concurrent run per ref; cancel in-progress if a newer push arrives.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
# Required to upload SARIF results to the repository Security tab.
security-events: write
# Required by ossf/scorecard-action when publish_results: true.
id-token: write
# Required to read source code.
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run OpenSSF Scorecard
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
# publish_results: true publishes the score to the public Scorecard API
# (https://api.securityscorecards.dev) and enables the README badge.
# Requires id-token: write (OIDC) and only takes effect on the default
# branch; pull_request runs always skip publishing.
publish_results: true
- name: Upload SARIF artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: scorecard-results
path: results.sarif
retention-days: 5
- name: Upload SARIF to GitHub Security tab
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
with:
sarif_file: results.sarif