Repository navigation
72 lines (65 loc) · 2.54 KB
/
Copy pathscorecard.yml
File metadata and controls
72 lines (65 loc) · 2.54 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
66
67
68
69
70
71
72
# Runs only while the repository is public: nothing is analysed or published while it is private.
# Branch protection events carry the visibility in their payload; a
# scheduled run carries no repository, so its first job reads it from the API.
# No push trigger (decided 2026-10-14): Scorecard prints the event that
# started it, and a push event names the pusher's email address.
#
# OpenSSF Scorecard: an automated, weekly audit of this repo's supply-chain
# security posture (Signed-Releases, Token-Permissions, Pinned-Dependencies,
# Dangerous-Workflow, and more). publish_results feeds the public report at
# scorecard.dev; the SARIF upload surfaces findings in this repo's Security
# tab.
#
# Actions are pinned by commit SHA on purpose: Scorecard's own
# Pinned-Dependencies check expects it, and it is the posture the rest of this
# project's supply chain already takes.
name: Scorecard
on:
branch_protection_rule:
schedule:
- cron: '27 4 * * 1'
permissions: read-all
jobs:
visibility:
name: Repository visibility
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
visibility: ${{ steps.read.outputs.visibility }}
steps:
- id: read
run: echo "visibility=$(gh api "repos/${GITHUB_REPOSITORY}" --jq .visibility)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
analysis:
name: Scorecard analysis
needs: visibility
if: "!cancelled() && (github.event.repository.visibility == 'public' || needs.visibility.outputs.visibility == 'public')"
runs-on: ubuntu-latest
permissions:
security-events: write # upload the SARIF result to code scanning
id-token: write # publish results for the badge (OIDC)
steps:
- name: Checkout
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code scanning
continue-on-error: true
uses: github/codeql-action/upload-sarif@6f5948dfacef28e207b48d0905cf90c03365536d # v3
with:
sarif_file: results.sarif