diff --git a/.github/workflows/__call-common-lint.yml b/.github/workflows/__call-common-lint.yml index 32d53c56..73b8b6e4 100644 --- a/.github/workflows/__call-common-lint.yml +++ b/.github/workflows/__call-common-lint.yml @@ -246,9 +246,19 @@ jobs: - name: Rust - setup toolchain if: always() && steps.run_cargo.outputs.found_cargo == 'true' - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt + env: + RUST_COMPONENTS: rustfmt + run: | + # If no toolchain file exists, set to stable + if [ ! -f "rust-toolchain.toml" ] && [ ! -f "rust-toolchain" ]; then + rustup default stable + fi + + # Install components for the active toolchain + rustup component add ${RUST_COMPONENTS} + + # Display current toolchain information + rustup show - name: Rust - cargo fmt if: always() && steps.run_cargo.outputs.found_cargo == 'true'