Skip to content

Commit 488e359

Browse files
ci: add OpenSSF Scorecard workflow (#17)
Same pinned workflow already running in the other SantanderAI repos (weekly schedule + push to main, results published to code scanning).
1 parent 1c9fc0e commit 488e359

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/scorecard.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Copyright (c) 2026 Santander Group
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# OpenSSF Scorecard supply-chain security analysis.
5+
# Runs weekly + on push to main + when branch protection rules change.
6+
# Results published to scorecard.dev (public dashboard) and uploaded to the
7+
# repository's Code Scanning view.
8+
#
9+
# Like CodeQL, this workflow uploads SARIF results which on private repos
10+
# requires GitHub Advanced Security. The analyze job is therefore skipped
11+
# while the repo is private; it activates automatically once flipped to
12+
# public.
13+
14+
name: Scorecard supply-chain security
15+
16+
on:
17+
branch_protection_rule:
18+
schedule:
19+
- cron: "20 7 * * 2" # weekly Tuesday 07:20 UTC
20+
push:
21+
branches: [main]
22+
23+
permissions: read-all
24+
25+
jobs:
26+
analysis:
27+
name: Scorecard analysis
28+
runs-on: ubuntu-latest
29+
timeout-minutes: 30
30+
permissions:
31+
security-events: write # required by upload-sarif
32+
id-token: write # required to publish results to scorecard.dev
33+
contents: read
34+
actions: read
35+
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
39+
with:
40+
persist-credentials: false
41+
42+
- name: Run analysis
43+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
44+
with:
45+
results_file: results.sarif
46+
results_format: sarif
47+
# Publish results to https://api.securityscorecards.dev so the
48+
# public dashboard / badge can serve them.
49+
publish_results: true
50+
51+
- name: Upload SARIF as artifact
52+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
53+
with:
54+
name: scorecard-sarif
55+
path: results.sarif
56+
retention-days: 14
57+
58+
- name: Upload SARIF to GitHub Code Scanning
59+
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
60+
with:
61+
sarif_file: results.sarif

0 commit comments

Comments
 (0)