[INVESTIGATED/TESTED] Configuration File Pathing Issue + Subsequent Issue
kgrv-me opened this issue · comments
kgrv-me commented
Please refer to PR #59 for detailed solutions.
ISSUES
hadolint-action
cannot receive configuration file properly- Conflict infomation between
README.md
andaction.yml
inputs.config.default
is empty inaction.yml
, whileREADME.md
states otherwise- Default path stated in
README.md
would still encounter the above issue
- (Edited) the official
hadolint/hadolint:latest
container also suffers from configuration file issue
TEST CASES
- All done within GitHub Actions workflow
- All results in failure to receive configuration file
- uses: hadolint/hadolint-action@v2.1.0
with:
config: PATH
Substitute PATH
with the followings:
hadolint.yaml
./hadolint.yaml
.hadolint.yaml
/home/runner/work/sandbox/sandbox/hadolint.yaml
INVESTIGATION
hadolint
looks for configuration files via
$PWD/.hadolint.yaml
$XDG_CONFIG_HOME/hadolint.yaml
$HOME/.config/hadolint.yaml
$HOME/.hadolint/hadolint.yaml or $HOME/hadolint/config.yaml
$HOME/.hadolint.yaml
NOTE hadolint-action
utilizes Docker
container for execution
hadolint
usesPWD
andHOME
environment variablesaction.yml
mapsinputs.config
toHADOLINT_CONFIG
Dockerfile
points tohadolint.sh
for entrypointhadolint.sh
appends-c ${HADOLINT_CONFIG}
tohadolint
commandhadolint-action
usesDocker
with
docker run .. --workdir /github/workspace .. -v "/home/runner/work/sandbox/sandbox":"/github/workspace" ..
PWD=/
andHOME=/root
inside the container
CONCLUSION
- Since
pwd
inside the container isn't matching withPWD
norHOME
,hadolint
cannot find configuration file in usual places - Knowing
pwd
and-v
for the container, we can editPATH
to be/github/workspace/hadolint.yaml
forhadolint-action
to use
SUGGESTION
- Document the usage in
README.md
accordingly (CONCLUSION.2)
or - Change
PWD
/HOME
inDockerfile
to accommodate the differences
or - Prepend
/github/workspace/
to the path of configuration file
or preferably all of the above! :D - Please consider adding
MAJOR_VERSION
tag for the release (#47)
Thank you!
José Lorenzo Rodríguez commented
Would you like to submit a change with those fixes?