-
-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (78 loc) · 3.15 KB
/
scorecard.yml
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
name: 'Scorecard'
on: # yamllint disable-line rule:truthy
# 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: {}
# To guarantee Maintained check is occasionally updated. See
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
schedule:
- cron: '43 17 * * 4'
push:
branches:
- 'main'
workflow_dispatch: {}
# 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'
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
steps:
- name: 'Harden Runner'
uses: 'step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6' # v2.8.1
with:
egress-policy: 'block'
disable-sudo: true
allowed-endpoints: >
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
api.securityscorecards.dev:443
fulcio.sigstore.dev:443
github.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
- name: 'Checkout the repository'
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'
repo_token: '${{ secrets.SCORECARD_TOKEN }}'
# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
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@0b2256b8c012f0828dc542b3febcab082c67f72b' # v4.3.4
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@4fa2a7953630fd2f3fb380f21be14ede0169dd4f' # v3.25.12
with:
sarif_file: 'results.sarif'
...