Skip to content

Commit 9fe0d8f

Browse files
fix(rust-ci): pass explicit toolchain: stable to SHA-pinned dtolnay action (#439)
## What Add an explicit `toolchain: stable` input to all four `dtolnay/rust-toolchain` steps in `.github/workflows/rust-ci-reusable.yml` (the `check`, `test`, `audit`, and `coverage` jobs). ## Why The reusable bundle pins `dtolnay/rust-toolchain` by commit SHA (`@67ef31d5…`). That action infers the toolchain from its `@`-ref (e.g. `@stable` → `stable`), but a **SHA ref carries no version**, so the action's internal "parse toolchain version" step receives an empty `toolchain` and aborts: ``` 'toolchain' is a required input Process completed with exit code 1 ``` This is the estate-wide **`rust-ci / Cargo check + clippy + fmt`** red that appears on every PR across the ~28 repos consuming this reusable workflow. Confirmed live against `iseriser` run `28287559313` (job *Cargo check + clippy + fmt*), whose failed step logged the env line `toolchain:` (empty) immediately before the error. ## Fix Each step now passes `toolchain: stable`, matching the existing `# stable` pin comment. The `check` job keeps its `components: clippy, rustfmt`; the other three gain a `with:` block. No behavioural change beyond making the toolchain explicit — which is exactly what the SHA pin requires. ## Propagation Single-source fix: consumers pin this reusable by SHA and inherit the fix on the next standards-reusable pin refresh (the existing "refresh standards reusable pins to current HEAD" flow). No consumer-side edits are part of this PR. ## Verification - `python3 -c "import yaml; yaml.safe_load(...)"` → YAML parses. - All four `dtolnay/rust-toolchain` steps now carry `toolchain: stable` (grep-confirmed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx --- _Generated by [Claude Code](https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent bf32531 commit 9fe0d8f

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/rust-ci-reusable.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,14 @@ jobs:
149149
ref: ${{ github.ref }}
150150

151151
- name: Install Rust toolchain
152+
# `toolchain:` is mandatory because the action is pinned by commit SHA:
153+
# dtolnay/rust-toolchain infers the toolchain from the `@`-ref (e.g.
154+
# `@stable`), but a SHA ref carries no version, so the action's "parse
155+
# toolchain version" step fails with `'toolchain' is a required input`.
156+
# See standards estate-wide rust-ci red.
152157
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable
153158
with:
159+
toolchain: stable
154160
components: clippy, rustfmt
155161

156162
- name: Cache cargo registry and build
@@ -190,7 +196,10 @@ jobs:
190196
ref: ${{ github.ref }}
191197

192198
- name: Install Rust toolchain
199+
# `toolchain:` mandatory under SHA pin — see Cargo check job above.
193200
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable
201+
with:
202+
toolchain: stable
194203

195204
- name: Cache cargo registry and build
196205
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
@@ -230,7 +239,10 @@ jobs:
230239
ref: ${{ github.ref }}
231240

232241
- name: Install Rust toolchain
242+
# `toolchain:` mandatory under SHA pin — see Cargo check job above.
233243
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable
244+
with:
245+
toolchain: stable
234246

235247
- name: Install cargo-audit
236248
# Use the binstall path when available to skip a from-source rebuild
@@ -260,7 +272,10 @@ jobs:
260272
ref: ${{ github.ref }}
261273

262274
- name: Install Rust toolchain
275+
# `toolchain:` mandatory under SHA pin — see Cargo check job above.
263276
uses: dtolnay/rust-toolchain@67ef31d5b988238dd797d409d6f9574278e20537 # stable
277+
with:
278+
toolchain: stable
264279

265280
- name: Install tarpaulin
266281
run: cargo install cargo-tarpaulin --locked

0 commit comments

Comments
 (0)