Debian Codegraph @

.github/workflows/scorecards.yml

raw
1 # Copyright 2023 The Archivista Contributors
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
15 # This workflow uses actions that are not certified by GitHub. They are provided
16 # by a third-party and are governed by separate terms of service, privacy
17 # policy, and support documentation.
18
19 name: Scorecard supply-chain security
20 on:
21 # For Branch-Protection check. Only the default branch is supported. See
22 # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
23 branch_protection_rule:
24 # To guarantee Maintained check is occasionally updated. See
25 # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
26 schedule:
27 - cron: '20 7 * * 2'
28 push:
29 branches: ["main"]
30
31 # Declare default permissions as read only.
32 permissions: read-all
33
34 jobs:
35 analysis:
36 name: Scorecard analysis
37 runs-on: ubuntu-latest
38 permissions:
39 # Needed to upload the results to code-scanning dashboard.
40 security-events: write
41 # Needed to publish results and get a badge (see publish_results below).
42 id-token: write
43 contents: read
44 actions: read
45
46 steps:
47 - name: Harden Runner
48 uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
49 with:
50 egress-policy: audit
51
52 - name: "Checkout code"
53 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54 with:
55 persist-credentials: false
56
57 - name: "Run analysis"
58 uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
59 with:
60 results_file: results.sarif
61 results_format: sarif
62 # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
63 # - you want to enable the Branch-Protection check on a *public* repository, or
64 # - you are installing Scorecards on a *private* repository
65 # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
66 # repo_token: ${{ secrets.SCORECARD_TOKEN }}
67
68 # Public repositories:
69 # - Publish results to OpenSSF REST API for easy access by consumers
70 # - Allows the repository to include the Scorecard badge.
71 # - See https://github.com/ossf/scorecard-action#publishing-results.
72 # For private repositories:
73 # - `publish_results` will always be set to `false`, regardless
74 # of the value entered here.
75 publish_results: true
76
77 # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
78 # format to the repository Actions tab.
79 - name: "Upload artifact"
80 uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
81 with:
82 name: SARIF file
83 path: results.sarif
84 retention-days: 5
85
86 # Upload the results to GitHub's code scanning dashboard.
87 - name: "Upload to code-scanning"
88 uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # v3.29.5
89 with:
90 sarif_file: results.sarif