Skip to content

Commit 9b859d3

Browse files
committed
fix: add rustup default check in toolchain install step
1 parent 02be93d commit 9b859d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ runs:
179179
# rustup toolchain install is the new explicit way
180180
# https://github.com/rust-lang/rustup/issues/3635#issuecomment-2343511297
181181
rustup show active-toolchain || rustup toolchain install
182+
if ! rustup default &>/dev/null; then
183+
TOOLCHAIN=$(rustup show active-toolchain 2>/dev/null | awk '{print $1}' | sed 's/-.*//')
184+
[[ -n "$TOOLCHAIN" ]] && rustup default "$TOOLCHAIN" || rustup default stable
185+
fi
182186
if [[ -n $components ]]; then
183187
rustup component add ${components//,/ }
184188
fi

0 commit comments

Comments
 (0)