Skip to content

Commit c9b177b

Browse files
wallieswoodruffwdi
authored
run through stepsecurity hardener (#73)
* run through stepsecurity hardener Signed-off-by: Cam Parry <[email protected]> * remove harden runner Signed-off-by: Cam Parry <[email protected]> * Update .github/workflows/scorecards-analysis.yml Co-authored-by: William Woodruff <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
1 parent 1426486 commit c9b177b

File tree

3 files changed

+66
-10
lines changed

3 files changed

+66
-10
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
- "3.10"
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v2
23-
- uses: actions/setup-python@v2
22+
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
23+
- uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a
2424
with:
2525
python-version: ${{ matrix.python }}
2626
- name: deps
@@ -31,7 +31,7 @@ jobs:
3131
licenses:
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
3535
# adapted from Warehouse's bin/licenses
3636
- run: |
3737
for fn in $(find . -type f -name "*.py"); do
@@ -44,8 +44,8 @@ jobs:
4444
lint:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@v2
48-
- uses: actions/setup-python@v2
47+
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
48+
- uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a
4949
- name: deps
5050
run: make dev
5151
- name: lint
@@ -54,8 +54,8 @@ jobs:
5454
check-readme:
5555
runs-on: ubuntu-latest
5656
steps:
57-
- uses: actions/checkout@v2
58-
- uses: actions/setup-python@v2
57+
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
58+
- uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a
5959
- name: deps
6060
run: make dev
6161
- name: check-readme

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
name: Build, sign and publish release to PyPI
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@d171c3b028d844f2bf14e9fdec0c58114451e4bf
1818

19-
- uses: actions/setup-python@v2
19+
- uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a
2020

2121
- name: deps
2222
run: python -m pip install -U build
@@ -39,7 +39,7 @@ jobs:
3939
done
4040
4141
- name: publish
42-
uses: pypa/gh-action-pypi-publish@master
42+
uses: pypa/gh-action-pypi-publish@717ba43cfbb0387f6ce311b169a825772f54d295
4343
with:
4444
user: __token__
4545
password: ${{ secrets.PYPI_TOKEN }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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: [ main ]
10+
11+
# Declare default permissions as read only.
12+
permissions: read-all
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+
24+
steps:
25+
- name: "Checkout code"
26+
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
27+
with:
28+
persist-credentials: false
29+
30+
- name: "Run analysis"
31+
uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4
32+
with:
33+
results_file: results.sarif
34+
results_format: sarif
35+
# Read-only PAT token. To create it,
36+
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
37+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
38+
# Publish the results to enable scorecard badges. For more details, see
39+
# https://github.com/ossf/scorecard-action#publishing-results.
40+
# For private repositories, `publish_results` will automatically be set to `false`,
41+
# regardless of the value entered here.
42+
publish_results: true
43+
44+
# Upload the results as artifacts (optional).
45+
- name: "Upload artifact"
46+
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v2.3.1
47+
with:
48+
name: SARIF file
49+
path: results.sarif
50+
retention-days: 5
51+
52+
# Upload the results to GitHub's code scanning dashboard.
53+
- name: "Upload to code-scanning"
54+
uses: github/codeql-action/upload-sarif@7502d6e991ca767d2db617bfd823a1ed925a0d59 # v1.0.26
55+
with:
56+
sarif_file: results.sarif

0 commit comments

Comments
 (0)