Skip to content

Commit ee14f97

Browse files
committed
Pin reusable workflow actions to immutable SHAs
1 parent db65d27 commit ee14f97

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The reusable workflows are configured for least privilege:
88
- They run with `permissions: contents: read`.
99
- `actions/checkout` uses `persist-credentials: false`.
1010
- For `pull_request` events, fork PR jobs are blocked on `core` by default. Set `allow_fork_pr_on_core: true` only if you explicitly want to allow that.
11+
- Third-party actions are pinned to immutable commit SHAs.
1112

1213
Example:
1314
```yaml

.github/workflows/cargo-deny.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: core
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2424

2525
- name: Install stable Rust
26-
uses: dtolnay/rust-toolchain@stable
26+
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
2727

2828
- name: Install cargo-deny
2929
run: cargo install --locked cargo-deny

.github/workflows/code-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ jobs:
2727
if: ${{ inputs.allow_fork_pr_on_core || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2828
runs-on: core
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3131
with:
3232
persist-credentials: false
33-
- uses: dsherret/rust-toolchain-file@v1
33+
- uses: dsherret/rust-toolchain-file@3551321aa44dd44a0393eb3b6bdfbc5d25ecf621 # v1
3434
- run: cargo fmt --all -- --check
3535

3636
clippy:
3737
name: Clippy Check
3838
if: ${{ inputs.allow_fork_pr_on_core || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
3939
runs-on: core
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
4242
with:
4343
persist-credentials: false
44-
- uses: dsherret/rust-toolchain-file@v1
44+
- uses: dsherret/rust-toolchain-file@3551321aa44dd44a0393eb3b6bdfbc5d25ecf621 # v1
4545
- name: Run Clippy
4646
shell: bash
4747
env:

.github/workflows/dusk-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
if: ${{ inputs.allow_fork_pr_on_core || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2323
runs-on: core
2424
steps:
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
2626
with:
2727
persist-credentials: false
28-
- uses: dsherret/rust-toolchain-file@v1
28+
- uses: dsherret/rust-toolchain-file@3551321aa44dd44a0393eb3b6bdfbc5d25ecf621 # v1
2929

3030
- name: Dusk checks
3131
working-directory: ${{ inputs.working-directory }}

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
if: ${{ inputs.allow_fork_pr_on_core || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2828
runs-on: core
2929
steps:
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3131
with:
3232
persist-credentials: false
33-
- uses: dsherret/rust-toolchain-file@v1
33+
- uses: dsherret/rust-toolchain-file@3551321aa44dd44a0393eb3b6bdfbc5d25ecf621 # v1
3434
- name: Install Optional Rust Target
3535
if: ${{ inputs.rust_target }}
3636
shell: bash

0 commit comments

Comments
 (0)