Skip to content

Commit bb63cbe

Browse files
committed
Create scorecard.yml
1 parent 689fd15 commit bb63cbe

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/scorecard.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
pull_request:
8+
branches: [ "main" ]
9+
# For Branch-Protection check. Only the default branch is supported. See
10+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
11+
branch_protection_rule:
12+
# To guarantee Maintained check is occasionally updated. See
13+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
14+
schedule:
15+
- cron: '45 3 * * 2'
16+
push:
17+
branches: [ "main" ]
18+
19+
# Declare default permissions as read only.
20+
permissions: read-all
21+
22+
jobs:
23+
analysis:
24+
name: Scorecard analysis
25+
runs-on: ubuntu-latest
26+
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
27+
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
28+
permissions:
29+
# Needed to upload the results to code-scanning dashboard.
30+
security-events: write
31+
# Needed to publish results and get a badge (see publish_results below).
32+
id-token: write
33+
# Uncomment the permissions below if installing in a private repository.
34+
# contents: read
35+
# actions: read
36+
37+
steps:
38+
- name: "Checkout code"
39+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
persist-credentials: false
42+
43+
- name: "Run analysis"
44+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
45+
with:
46+
results_file: results.sarif
47+
results_format: sarif
48+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
49+
# - you want to enable the Branch-Protection check on a *public* repository, or
50+
# - you are installing Scorecard on a *private* repository
51+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
52+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
53+
54+
# Public repositories:
55+
# - Publish results to OpenSSF REST API for easy access by consumers
56+
# - Allows the repository to include the Scorecard badge.
57+
# - See https://github.com/ossf/scorecard-action#publishing-results.
58+
# For private repositories:
59+
# - `publish_results` will always be set to `false`, regardless
60+
# of the value entered here.
61+
publish_results: true
62+
63+
# (Optional) Uncomment file_mode if you have a .gitattributes with files marked export-ignore
64+
# file_mode: git
65+
66+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
67+
# format to the repository Actions tab.
68+
- name: "Upload artifact"
69+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
70+
with:
71+
name: SARIF file
72+
path: results.sarif
73+
retention-days: 5
74+
75+
# Upload the results to GitHub's code scanning dashboard (optional).
76+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
77+
- name: "Upload to code-scanning"
78+
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
79+
with:
80+
sarif_file: results.sarif

0 commit comments

Comments
 (0)