Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrectly constructed download URL for some architectures #122

Open
bwhitehead0 opened this issue Jul 19, 2023 · 1 comment
Open

incorrectly constructed download URL for some architectures #122

bwhitehead0 opened this issue Jul 19, 2023 · 1 comment

Comments

@bwhitehead0
Copy link

running the gitleaks action on my self-hosted ARM7 runner fails:

log snippet:

2023-07-19T04:36:09.9024034Z [bwhitehead0] is an individual user. No license key is required.
2023-07-19T04:36:09.9048238Z gitleaks version: 8.12.0
2023-07-19T04:36:09.9086434Z Version to install: 8.12.0 (target directory: /tmp/gitleaks-8.12.0)
2023-07-19T04:36:10.6016829Z Downloading gitleaks from https://github.com/zricethezav/gitleaks/releases/download/v8.12.0/gitleaks_8.12.0_linux_arm.tar.gz
2023-07-19T04:36:11.0949685Z ##[error]could not install gitleaks from https://github.com/zricethezav/gitleaks/releases/download/v8.12.0/gitleaks_8.12.0_linux_arm.tar.gz, error: Error: Unexpected HTTP response: 404
2023-07-19T04:36:11.1353564Z /home/github-runner/actions-runner/_work/_actions/gitleaks/gitleaks-action/v2.3.2/dist/index.js:8612

in this case, it appears that this code block might need to be modified to account for ARM variants:

    const gitleaksReleaseURL = downloadURL(
      process.platform,
      process.arch,
      version
    );

i'm not very familiar w/ node, but it appears we need to do something similar to this comment to properly construct the download URL for some ARM variants, or, find another way to determine architecture type is ARM, then poll the OS thru node to determine if it's arm64, arm6, or arm7.

os.cpus() (model) should report the ARM version:

node -p "os.cpus()"    
[ { model: 'ARMv7 Processor rev 5 (v7l)',
    speed: 900,
    times:
     { user: 28061900,
       nice: 1726100,
       sys: 41051200,
       idle: 3227428,
       irq: 0 } },
...

wish i could offer more but node isn't my thing.

@OdedRub
Copy link

OdedRub commented Dec 19, 2023

Having the same issue as well, on a Windows X64 self-hosted runner.
The action does work on GitHub's ubuntu-latest and on my Linux self-hosted runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants