install icon indicating copy to clipboard operation
install copied to clipboard

Action fails if binary already exists

Open fengyc opened this issue 5 years ago • 5 comments

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

fengyc avatar Jun 28 '20 03:06 fengyc

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

matklad avatar Jul 16 '20 08:07 matklad

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. ):

antifuchs avatar Jul 25 '20 15:07 antifuchs

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

Arzte avatar Aug 11 '20 17:08 Arzte

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).

Shadow53 avatar Sep 09 '21 21:09 Shadow53

i alos have this issue, should not fail if it already exists

Haaroon avatar Mar 07 '23 10:03 Haaroon