Forked to test out the following fix in Dockerfile:
# Set essential environment variables in the container
ENV HOME /github/workspace
ENV PWD /github/workspace
Set default WORKDIR in Dockerfile for easier trace and consistency
WORKDIR /github/workspace
It seems a bit crude to hardcode, it would lock-in that variable. However, I noticed the repository relies on GitHub environment; this would be just a-okay :D
- OR set the environment variables in `hadolint.sh` for more dynamic approach:
Set essential environment variables in the container
export {PWD,HOME}=$(pwd)
- Prepending `inputs.config` with a little bit of editing:
HADOLINT_CONFIG="-c ${PWD}/${HADOLINT_CONFIG}"
1. Not supplying `inputs.config` with `.hadolint.yaml` present works now! (it defaults back to `hadolint` configuration file places _INVESTIGATION.0_)
uses: kgrv-me/hadolint-action@fix/PathingIssue
Supply hadolint.yaml to inputs.config also works! (hadolint won't pick up hadolint.yaml by default)
/github/workspace seems intended to be default HOME in hadolint.sh for problem-matcher.json.
However, problem-matcher.json never made it ouside the container into the repository as intended due to HOME=/root (INVESTIGATION.6)
Fixing this ticket (pathing issue) via the above methods
would resolve `problem-matcher.json` condition as well!
Please refer to #58 for details of the issue(s).
SOLUTIONS
Dockerfile
:Set default WORKDIR in Dockerfile for easier trace and consistency
WORKDIR /github/workspace
Set essential environment variables in the container
export {PWD,HOME}=$(pwd)
HADOLINT_CONFIG="-c ${PWD}/${HADOLINT_CONFIG}"
hadolint.yaml
toinputs.config
also works! (hadolint
won't pick uphadolint.yaml
by default)EXTRA ISSUE NOTED
/github/workspace
seems intended to be defaultHOME
inhadolint.sh
forproblem-matcher.json
. However,problem-matcher.json
never made it ouside the container into the repository as intended due toHOME=/root
(INVESTIGATION.6)Cheers!