ludeeus / action-shellcheck

GitHub action for ShellCheck.
MIT License
292 stars 69 forks source link

Add support to run action on self-hosted runner #90

Open ilciko opened 1 year ago

ilciko commented 1 year ago

Use GITHUB_ACTION_PATH instead of github.action_path for Docker compliance Add in README.md instruction to run on self-hosted container (missing packages)

ilciko commented 1 year ago

Hello, when action run on self-hosted server using container, actions MP is exposed as: -v "/home/rocky/actions-runner/_work/_actions":"/__w/_actions"

docker.io/library/rockylinux:8
  /usr/bin/docker create [omissis] -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/rocky/actions-runner/_work":"/__w" -v "/home/rocky/actions-runner/externals":"/__e":ro -v "/home/rocky/actions-runner/_work/_temp":"/__w/_temp" -v "/home/rocky/actions-runner/_work/_actions":"/__w/_actions" -v "/home/rocky/actions-runner/_work/_tool":"/__w/_tool" -v "/home/rocky/actions-runner/_work/_temp/_github_home":"/github/home" -v "/home/rocky/actions-runner/_work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" rockylinux:8 "-f" "/dev/null"

From debug you can see that: "${{ github.action_path }}" == /home/rocky/actions-runner/_work/_actions/ilciko/action-shellcheck/ "${GITHUB_ACTION_PATH}" == /__w/_actions/ilciko/action-shellcheck/

the value of ${{ github.action_path }} point at /home/rocky/actions-runner/_work/_actions, that's not present inside a container. Instead the value ${GITHUB_ACTION_PATH} point at right place in both cases (github cloud instance and docker on self-hosted too)

Here a discussion about this problem: https://github.com/actions/runner/issues/716