Skip to content

Commit fe22813

Browse files
committed
fix(run-pre-commit): Replace commas with underscores in cache key
1 parent 5504c93 commit fe22813

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

run-pre-commit/action.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,22 @@ 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+
if: ${{ inputs.rust }}
64+
shell: bash
65+
env:
66+
RUST_COMPONENTS: ${{ inputs.rust-components }}
67+
run: |
68+
RUST_COMPONENTS=${RUST_COMPONENTS//,/_}
69+
echo "RUST_COMPONENTS=$RUST_COMPONENTS" | tee -a "$GITHUB_ENV"
70+
6271
- name: Setup Rust Toolchain Cache
6372
id: rust-toolchain-cache
6473
if: ${{ inputs.rust }}
6574
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6675
with:
6776
path: ~/.rustup/toolchains
68-
key: rust-toolchains-${{ inputs.rust }}-components-${{ inputs.rust-components }}
77+
key: rust-toolchains-${{ inputs.rust }}-components-${{ env.RUST_COMPONENTS }}
6978

7079
- name: Setup Rust Toolchain
7180
uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c

0 commit comments

Comments
 (0)