Skip to content

Commit a9d431e

Browse files
committed
fix(run-pre-commit): Replace commas with underscores in cache key
1 parent 2bd2770 commit a9d431e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

run-pre-commit/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,21 @@ runs:
5959
path: ~/.cache/pre-commit
6060
key: pre-commit-${{ inputs.pre-commit-version }}-python${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
6161

62+
- name: Format Rust Toolchain Cache Key
63+
shell: bash
64+
env:
65+
RUST_COMPONENTS: ${{ inputs.rust-components }}
66+
run: |
67+
RUST_COMPONENTS=${RUST_COMPONENTS//,/_}
68+
echo "RUST_COMPONENTS=$RUST_COMPONENTS" | tee -a "$GITHUB_ENV"
69+
6270
- name: Setup Rust Toolchain Cache
6371
id: rust-toolchain-cache
6472
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6573
if: ${{ inputs.rust }}
6674
with:
6775
path: ~/.rustup/toolchains
68-
key: rust-toolchains-${{ inputs.rust }}-components-${{ inputs.rust-components }}
76+
key: rust-toolchains-${{ inputs.rust }}-components-${{ env.RUST_COMPONENTS }}
6977

7078
- name: Setup Rust Toolchain
7179
uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c

0 commit comments

Comments
 (0)