install
install copied to clipboard
Action fails if binary already exists
Description
Github action fails if binary already exists.
Workflow code
- name: Rust install cargo-deb
uses: actions-rs/[email protected]
with:
crate: cargo-deb
version: latest
Action output
Newest cargo-deb version available at crates.io: 1.24.0
Downloading cargo-deb signature into /tmp/cargo-deb.zip.sig
Downloading cargo-deb == 1.24.0 into /tmp/cargo-deb.zip
Starting signature verification process
/usr/bin/openssl dgst -sha256 -verify /home/runner/work/_actions/actions-rs/install/v0.1/public.pem -signature /tmp/cargo-deb.zip.sig /tmp/cargo-deb.zip
Verified OK
Extracting files into /home/runner/.cargo/bin
/usr/bin/unzip /tmp/cargo-deb.zip
Archive: /tmp/cargo-deb.zip
replace cargo-deb? [y]es, [n]o, [A]ll, [N]one, [r]ename:
##[error]The operation was canceled.
Expected behavior
Need an option to ignore/replace binary if it exits.
Additional context
We are hitting this in rust-analyzer as well: https://github.com/rust-analyzer/rust-analyzer/runs/875767848?check_suite_focus=true#step:3:26
I dug, and it looks like the extractZip function doesn't appear to call unzip with the argument that makes it stop prompting. However, I couldn't find where that function is defined. ):
Did a bit of digging and looks like extractZip is defined here https://github.com/actions/toolkit/blob/1cc56db0ff126f4d65aeb83798852e02a2c180c3/packages/tool-cache/src/tool-cache.ts#L324-L368 in actions/toolkit
Just ran into this on some projects. The action fell back to using cargo install and suggested I use --force to make overwrite the previous installation (that was cached from a previous run).
i alos have this issue, should not fail if it already exists