Skip to content

Commit d23219f

Browse files
[StepSecurity] ci: Harden GitHub Actions (#1561)
Signed-off-by: StepSecurity Bot <[email protected]>
1 parent 4400f61 commit d23219f

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

Diff for: .github/workflows/ci-win.yml

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ jobs:
2727
- windows-2022
2828
runs-on: ${{ matrix.os }}
2929
steps:
30+
- name: Harden Runner
31+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
32+
with:
33+
egress-policy: audit
34+
3035
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3136
- name: Set up Python ${{ env.PYTHON_VERSION }}
3237
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0

Diff for: .github/workflows/ci.yml

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ jobs:
3232
compiler: gcc # GCC is an alias for clang on the MacOS image.
3333
runs-on: ${{ matrix.os }}
3434
steps:
35+
- name: Harden Runner
36+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
37+
with:
38+
egress-policy: audit
39+
3540
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3641
- name: Set up Python ${{ env.PYTHON_VERSION }}
3742
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0

Diff for: .github/workflows/coverage-linux.yml

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
coverage-linux:
3535
runs-on: ubuntu-latest
3636
steps:
37+
- name: Harden Runner
38+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
39+
with:
40+
egress-policy: audit
41+
3742
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3843
with:
3944
persist-credentials: false

Diff for: .github/workflows/linter.yml

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ jobs:
1515

1616
runs-on: ${{ matrix.os }}
1717
steps:
18+
- name: Harden Runner
19+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
20+
with:
21+
egress-policy: audit
22+
1823
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1924
with:
2025
fetch-depth: 0

Diff for: .github/workflows/release-please.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ jobs:
1212
outputs:
1313
release_created: ${{ steps.release.outputs.release_created }}
1414
steps:
15-
- uses: googleapis/release-please-action@v4
15+
- name: Harden Runner
16+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
17+
with:
18+
egress-policy: audit
19+
20+
- uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
1621
id: release
1722
with:
1823
config-file: release-please-config.json
@@ -23,8 +28,13 @@ jobs:
2328
if: ${{ needs.release-please.outputs.release_created }}
2429
runs-on: ubuntu-latest
2530
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-node@v4
31+
- name: Harden Runner
32+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
33+
with:
34+
egress-policy: audit
35+
36+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
37+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
2838
with:
2939
node-version: lts/*
3040
registry-url: 'https://registry.npmjs.org'

Diff for: .github/workflows/stale.yml

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
pull-requests: write # for actions/stale to close stale PRs
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Harden Runner
17+
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
18+
with:
19+
egress-policy: audit
20+
1621
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
1722
with:
1823
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)