Skip to content

Commit 20cd408

Browse files
ci: add openssf scanning
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
1 parent 78b592b commit 20cd408

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/scorecard.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
branch_protection_rule:
8+
# To guarantee Maintained check is occasionally updated. See
9+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
10+
schedule:
11+
- cron: '19 10 * * 0'
12+
push:
13+
branches: [ "develop" ]
14+
15+
# Declare default permissions as read only.
16+
permissions: read-all
17+
18+
jobs:
19+
analysis:
20+
name: Scorecard analysis
21+
runs-on: ubuntu-latest
22+
permissions:
23+
# Needed to upload the results to code-scanning dashboard.
24+
security-events: write
25+
# Needed to publish results and get a badge (see publish_results below).
26+
id-token: write
27+
28+
steps:
29+
- name: "Checkout code"
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
persist-credentials: false
33+
34+
- name: "Run analysis"
35+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
36+
with:
37+
results_file: results.sarif
38+
results_format: sarif
39+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
40+
# - you want to enable the Branch-Protection check on a *public* repository, or
41+
# - you are installing Scorecard on a *private* repository
42+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
43+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
44+
45+
# Public repositories:
46+
# - Publish results to OpenSSF REST API for easy access by consumers
47+
# - Allows the repository to include the Scorecard badge.
48+
# - See https://github.com/ossf/scorecard-action#publishing-results.
49+
# For private repositories:
50+
# - `publish_results` will always be set to `false`, regardless
51+
# of the value entered here.
52+
publish_results: true
53+
54+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
55+
# format to the repository Actions tab.
56+
- name: "Upload artifact"
57+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
58+
with:
59+
name: SARIF file
60+
path: results.sarif
61+
retention-days: 5
62+
63+
# Upload the results to GitHub's code scanning dashboard (optional).
64+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
65+
- name: "Upload to code-scanning"
66+
uses: github/codeql-action/upload-sarif@v3
67+
with:
68+
sarif_file: results.sarif

0 commit comments

Comments
 (0)