...
1# Copyright 2022 The Sigstore Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15name: Scorecards supply-chain security
16on:
17 # Only the default branch is supported.
18 branch_protection_rule:
19 schedule:
20 # Weekly on Saturdays.
21 - cron: '30 1 * * 6'
22 push:
23 branches: [ main ]
24
25# Declare default permissions as read only.
26permissions: read-all
27
28jobs:
29 analysis:
30 name: Scorecards analysis
31 runs-on: ubuntu-latest
32 permissions:
33 # Needed to upload the results to code-scanning dashboard.
34 security-events: write
35 actions: read
36 contents: read
37 id-token: write
38 steps:
39 - name: "Checkout code"
40 uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
41 with:
42 persist-credentials: false
43
44 - name: "Run analysis"
45 uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
46 with:
47 results_file: results.sarif
48 results_format: sarif
49 # Read-only PAT token. To create it,
50 # follow the steps in https://github.com/ossf/scorecard-action#installation.
51 repo_token: ${{ secrets.SCORECARD_TOKEN }}
52 # Publish the results for public repositories to enable scorecard badges. For more details, see
53 # https://github.com/ossf/scorecard-action#publishing-results.
54 # For private repositories, `publish_results` will automatically be set to `false`, regardless
55 # of the value entered here.
56 publish_results: true
57
58 # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
59 # format to the repository Actions tab.
60 - name: "Upload artifact"
61 uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
62 with:
63 name: SARIF file
64 path: results.sarif
65 retention-days: 5
66
67 # Upload the results to GitHub's code scanning dashboard.
68 - name: "Upload to code-scanning"
69 uses: github/codeql-action/upload-sarif@cdcdbb579706841c47f7063dda365e292e5cad7a # v2.13.4
70 with:
71 sarif_file: results.sarif
View as plain text