Skip to content

Commit e3b8d2d

Browse files
fix(cargo-fmt): use project toolchain (#470)
1 parent c0956e6 commit e3b8d2d

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/__call-common-lint.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,19 @@ jobs:
246246
247247
- name: Rust - setup toolchain
248248
if: always() && steps.run_cargo.outputs.found_cargo == 'true'
249-
uses: dtolnay/rust-toolchain@stable
250-
with:
251-
components: rustfmt
249+
env:
250+
RUST_COMPONENTS: rustfmt
251+
run: |
252+
# If no toolchain file exists, set to stable
253+
if [ ! -f "rust-toolchain.toml" ] && [ ! -f "rust-toolchain" ]; then
254+
rustup default stable
255+
fi
256+
257+
# Install components for the active toolchain
258+
rustup component add ${RUST_COMPONENTS}
259+
260+
# Display current toolchain information
261+
rustup show
252262
253263
- name: Rust - cargo fmt
254264
if: always() && steps.run_cargo.outputs.found_cargo == 'true'

0 commit comments

Comments
 (0)