Skip to content

Commit 01a67b5

Browse files
[StepSecurity] Apply security best practices (#26)
Signed-off-by: StepSecurity Bot <[email protected]> Co-authored-by: stepsecurity-app[bot] <188008098+stepsecurity-app[bot]@users.noreply.github.com>
1 parent e151878 commit 01a67b5

File tree

4 files changed

+47
-9
lines changed

4 files changed

+47
-9
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ jobs:
66
deploy-docs:
77
runs-on: ubuntu-latest
88
steps:
9+
- name: Harden the runner (Audit all outbound calls)
10+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
11+
with:
12+
egress-policy: audit
13+
914
- name: Check out
10-
uses: actions/checkout@v4
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1116

1217
- name: Set up the environment
1318
uses: ./.github/actions/setup-poetry-env

.github/workflows/main.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ jobs:
1111
quality:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- name: Harden the runner (Audit all outbound calls)
15+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
16+
with:
17+
egress-policy: audit
18+
1419
- name: Check out
15-
uses: actions/checkout@v4
20+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1621

17-
- uses: actions/cache@v4
22+
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
1823
with:
1924
path: ~/.cache/pre-commit
2025
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
@@ -35,8 +40,13 @@ jobs:
3540
run:
3641
shell: bash
3742
steps:
43+
- name: Harden the runner (Audit all outbound calls)
44+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
45+
with:
46+
egress-policy: audit
47+
3848
- name: Check out
39-
uses: actions/checkout@v4
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4050

4151
- name: Set up the environment
4252
uses: ./.github/actions/setup-poetry-env
@@ -53,14 +63,19 @@ jobs:
5363
run: poetry run pyright
5464

5565
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.13
56-
uses: codecov/codecov-action@v4
66+
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
5767
if: ${{ matrix.python-version == '3.13' }}
5868

5969
check-docs:
6070
runs-on: ubuntu-latest
6171
steps:
72+
- name: Harden the runner (Audit all outbound calls)
73+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
74+
with:
75+
egress-policy: audit
76+
6277
- name: Check out
63-
uses: actions/checkout@v4
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6479

6580
- name: Set up the environment
6681
uses: ./.github/actions/setup-poetry-env

.github/workflows/on-release-main.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
steps:
12+
- name: Harden the runner (Audit all outbound calls)
13+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
14+
with:
15+
egress-policy: audit
16+
1217
- name: Check out
13-
uses: actions/checkout@v4
18+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1419

1520
- name: Set up the environment
1621
uses: ./.github/actions/setup-poetry-env
@@ -31,8 +36,13 @@ jobs:
3136
needs: publish
3237
runs-on: ubuntu-latest
3338
steps:
39+
- name: Harden the runner (Audit all outbound calls)
40+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
41+
with:
42+
egress-policy: audit
43+
3444
- name: Check out
35-
uses: actions/checkout@v4
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3646

3747
- name: Set up the environment
3848
uses: ./.github/actions/setup-poetry-env

.github/workflows/validate-codecov-config.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ on:
66
push:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
validate-codecov-config:
1114
runs-on: ubuntu-22.04
1215
steps:
13-
- uses: actions/checkout@v4
16+
- name: Harden the runner (Audit all outbound calls)
17+
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
18+
with:
19+
egress-policy: audit
20+
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1422
- name: Validate codecov configuration
1523
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate

0 commit comments

Comments
 (0)