Skip to content

Commit c2abe71

Browse files
Use master branch for Scorecards
1 parent 6397c99 commit c2abe71

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
name: 'Dependency Review'
15+
on: [pull_request]
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
dependency-review:
22+
name: License and Vulnerability Scan
23+
uses: sigstore/community/.github/workflows/reusable-dependency-review.yml@9b1b5aca605f92ec5b1bf3681b1e61b3dbc420cc
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Scorecards supply-chain security
2+
on:
3+
# Only the default branch is supported.
4+
workflow_dispatch: # Manual
5+
branch_protection_rule:
6+
schedule:
7+
- cron: '30 4 * * 0'
8+
push:
9+
branches: [ master ]
10+
11+
# Clear default permissions.
12+
permissions: {}
13+
14+
jobs:
15+
analysis:
16+
name: Scorecards analysis
17+
runs-on: ubuntu-latest
18+
permissions:
19+
# Needed to upload the results to code-scanning dashboard.
20+
security-events: write
21+
actions: read
22+
contents: read
23+
# Needed to access GitHub's OIDC token which ensures the uploaded results integrity.
24+
id-token: write
25+
steps:
26+
- name: "Checkout code"
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
28+
with:
29+
persist-credentials: false
30+
31+
- name: "Run analysis"
32+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
33+
with:
34+
results_file: results.sarif
35+
results_format: sarif
36+
# Read-only PAT token. To create it,
37+
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
38+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
39+
# Publish the results to enable scorecard badges. For more details, see
40+
# https://github.com/ossf/scorecard-action#publishing-results.
41+
# For private repositories, `publish_results` will automatically be set to `false`,
42+
# regardless of the value entered here.
43+
publish_results: true
44+
45+
# Upload the results as artifacts (optional).
46+
- name: "Upload artifact"
47+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
48+
with:
49+
name: SARIF file
50+
path: results.sarif
51+
retention-days: 5
52+
53+
# Upload the results to GitHub's code scanning dashboard.
54+
- name: "Upload to code-scanning"
55+
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
56+
with:
57+
sarif_file: results.sarif
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: SLSA provenance for releases
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
permissions: {}
10+
11+
jobs:
12+
provenance:
13+
name: Generate SLSA provenance
14+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.10.0
15+
permissions:
16+
actions: read
17+
contents: write
18+
id-token: write
19+
with:
20+
build-command: |
21+
python -m pip install --upgrade pip
22+
pip install build
23+
python -m build
24+
mkdir -p artifacts
25+
shopt -s nullglob
26+
cp dist/*.whl dist/*.tar.gz artifacts/
27+
provenance-name: gsppy-provenance.intoto.jsonl
28+
upload-assets: true

0 commit comments

Comments
 (0)