hadolint / hadolint-action

GitHub action for Hadolint, A Dockerfile linting tool
MIT License
192 stars 50 forks source link

Error: Unable to process command '::add-matcher::./tmp.nA8912gdP6/problem-matcher.json' #44

Open mblottiere opened 2 years ago

mblottiere commented 2 years ago

More often that not, the action fails seemingly randomly with the following error message:

Error: Unable to process command '::add-matcher::./tmp.nA8912gdP6/problem-matcher.json' successfully.
Error: Could not find a part of the path '/home/runner/work/XXXX/XXXX/tmp.nA8912gdP6/problem-matcher.json'.

Would it make sense to make the problem matcher opt-out?

jnmoal commented 2 years ago

I ended up on the same issue, looks like there might be a race condition between this action and GitHub, because the temp folder is removed as a cleanup step, while adding a matcher on it.

Also, about the hadolint.sh script, return codes are never checked, is there any reason for this? Please, note that shell script will continue if a command fail. To make it exit, manually check the result of the command (using $?) or put set -o errexit (which makes the script exit as soon as a command return a non zero exit code) at the top of the script.