jbergstroem / hadolint-gh-action

A hadolint linter for github actions that provides code annotations (and more)
MIT License
12 stars 5 forks source link

Install fails with: mv: cannot move '/tmp/hadolint' to '/usr/local/bin/hadolint': Permission denied #144

Closed itssimon closed 7 months ago

itssimon commented 7 months ago

Since version 2.12.0 this action always fails on our self-hosted runners with the following output:

> Run jbergstroem/hadolint-gh-action@v1
  with:
    dockerfile: ./Dockerfile
    error_level: 0
    annotate: true
    version: 2.12.0
> Run /runner/_work/_actions/jbergstroem/hadolint-gh-action/v1/install.sh
  /runner/_work/_actions/jbergstroem/hadolint-gh-action/v1/install.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    version: 2.12.0
mv: cannot move '/tmp/hadolint' to '/usr/local/bin/hadolint': Permission denied
1
Error: Process completed with exit code 1.

For context, the self-hosted runner is using this Docker image: summerwind/actions-runner-dind:v2.312.0-ubuntu-22.04

jbergstroem commented 7 months ago

Since version 2.12.0 this action always fails on our self-hosted runners with the following output:

For context, the self-hosted runner is using this Docker image: summerwind/actions-runner-dind:v2.312.0-ubuntu-22.04

Got it; I don't have a test suite to cover this; so I'll just sudo for now.

itssimon commented 7 months ago

I'm happy to test if you have a potentially fixed version in a branch!

jbergstroem commented 7 months ago

I'm happy to test if you have a potentially fixed version in a branch!

Can you test the linked PR?

jbergstroem commented 7 months ago

By the way, I think this is a bug in the upstream image. The world-writable bit for /usr/local/bin was introduced so npm install -g would work for non-root users: https://github.com/actions/runner-images/issues/3727