Open kgrv-me opened 2 years ago
Please refer to PR #59 for detailed solutions.
hadolint-action
README.md
action.yml
inputs.config.default
hadolint/hadolint:latest
- uses: hadolint/hadolint-action@v2.1.0 with: config: PATH
Substitute PATH with the followings:
PATH
hadolint.yaml ./hadolint.yaml .hadolint.yaml /home/runner/work/sandbox/sandbox/hadolint.yaml
hadolint
$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
Docker
PWD
HOME
inputs.config
HADOLINT_CONFIG
Dockerfile
hadolint.sh
-c ${HADOLINT_CONFIG}
docker run .. --workdir /github/workspace .. -v "/home/runner/work/sandbox/sandbox":"/github/workspace" ..
PWD=/
HOME=/root
pwd
-v
/github/workspace/hadolint.yaml
/github/workspace/
MAJOR_VERSION
Thank you!
Would you like to submit a change with those fixes?
@lorenzo I could definitely do that! ~How would I proceed to do so?~ EDIT: I have opened PR #59 for the solutions :D
Please refer to PR #59 for detailed solutions.
ISSUES
hadolint-action
cannot receive configuration file properlyREADME.md
andaction.yml
inputs.config.default
is empty inaction.yml
, whileREADME.md
states otherwiseREADME.md
would still encounter the above issuehadolint/hadolint:latest
container also suffers from configuration file issueTEST CASES
Substitute
PATH
with the followings:INVESTIGATION
hadolint
looks for configuration files viaNOTE
hadolint-action
utilizesDocker
container for executionhadolint
usesPWD
andHOME
environment variablesaction.yml
mapsinputs.config
toHADOLINT_CONFIG
Dockerfile
points tohadolint.sh
for entrypointhadolint.sh
appends-c ${HADOLINT_CONFIG}
tohadolint
commandhadolint-action
usesDocker
withPWD=/
andHOME=/root
inside the containerCONCLUSION
pwd
inside the container isn't matching withPWD
norHOME
,hadolint
cannot find configuration file in usual placespwd
and-v
for the container, we can editPATH
to be/github/workspace/hadolint.yaml
forhadolint-action
to useSUGGESTION
README.md
accordingly (CONCLUSION.2) orPWD
/HOME
inDockerfile
to accommodate the differences or/github/workspace/
to the path of configuration file or preferably all of the above! :DMAJOR_VERSION
tag for the release (#47)Thank you!