From 6047b38df831b10ba3fb72b3fbeafeda4abcfb36 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 13 Jun 2025 19:45:35 -0400 Subject: [PATCH] fix(cargo-fmt): use project toolchain --- .github/workflows/__call-common-lint.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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'