diff --git a/run-pre-commit/README.md b/run-pre-commit/README.md index 3b61c8d..0614777 100644 --- a/run-pre-commit/README.md +++ b/run-pre-commit/README.md @@ -41,6 +41,7 @@ jobs: - `pre-commit-version` (defaults to `4.2.0`) - `rust` (eg: `1.80.1`. Disabled if not specified) - `rust-components` (defaults to `rustfmt,clippy`) +- `rustup-version` (defaults to `1.28.1`) - `hadolint` (eg: `v2.12.0`. Disabled if not specified) - `nix` (eg: `2.25.2`. Disabled if not specified) - `nix-github-token` (eg: `secrets.GITHUB_TOKEN`. Required when `nix` is set) diff --git a/run-pre-commit/action.yml b/run-pre-commit/action.yml index f3e43f1..30421b0 100644 --- a/run-pre-commit/action.yml +++ b/run-pre-commit/action.yml @@ -18,6 +18,9 @@ inputs: Override which Rust components are installed. Only takes effect when Rust is installed. default: rustfmt,clippy + rustup-version: + description: Rustup version used when setting up the Rust toolchain(s) + default: 1.28.1 hadolint: description: Whether to install hadolint (and which version to use) nix: @@ -74,7 +77,7 @@ runs: uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 with: path: ~/.rustup/toolchains - key: rust-toolchains-${{ inputs.rust }}-components-${{ env.RUST_COMPONENTS }} + key: rust-toolchains-${{ inputs.rust }}-components-${{ env.RUST_COMPONENTS }}-rustup-${{ inputs.rustup-version }} - name: Setup Rust Toolchain uses: dtolnay/rust-toolchain@56f84321dbccf38fb67ce29ab63e4754056677e0 @@ -82,6 +85,7 @@ runs: with: toolchain: ${{ inputs.rust }} components: ${{ inputs.rust-components }} + rustup-version: ${{ inputs.rustup-version }} - name: Install Hadolint if: ${{ inputs.hadolint }}