Skip to content

Can not install gitleaks for selfhosted runner (Destination file path /tmp/gitleaks.tmp already exists) #127

@sydseter

Description

@sydseter

I understand this is meant to be used with docker, but perhaps it would be an idea to try to remove gitleaks.tmp from tmp before or after download and extraction?

For our self-hosted runner we fixed this by removing /tmp/gitleaks.tmp before running gitleaks-action

e.g:

  - name: Remove gitleaks from tmp if it exist
    run: rm -f /tmp/gitleaks.tmp || echo "gitleaks.tmp has already been removed."
gitleaks version: 8.18.0
Version to install: 8.18.0 (target directory: /tmp/gitleaks-8.18.0)
Downloading gitleaks from https://github.com/zricethezav/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz
Destination file path /tmp/gitleaks.tmp already exists
Waiting 19 seconds before trying again
Destination file path /tmp/gitleaks.tmp already exists
Waiting 17 seconds before trying again
Error: could not install gitleaks from https://github.com/zricethezav/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz, error: Error: Destination file path /tmp/gitleaks.tmp already exists
/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:86[12](https://github.com/AdmincontrolAS/unicorn/actions/runs/6705241157/job/18219262014?pr=8355#step:3:13)
            throw new Error("parameter 'file' is required");
                  ^

Error: parameter 'file' is required
    at Object.<anonymous> (/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:8612:19)
    at Generator.next (<anonymous>)
    at /actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:8411:71
    at new Promise (<anonymous>)
    at __webpack_modules__.7784.__awaiter (/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:8407:12)
    at Object.extractTar (/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:8610:12)
    at Object.Install (/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:70516:16)
    at async start (/actions-runner/_work/_actions/AdmincontrolAS/gitleaks-action/v2/dist/index.js:7[13](https://github.com/AdmincontrolAS/unicorn/actions/runs/6705241157/job/18219262014?pr=8355#step:3:14)42:[22](https://github.com/AdmincontrolAS/unicorn/actions/runs/6705241157/job/18219262014?pr=8355#step:3:23))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions