-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hadolint_output is empty #147
Comments
Thanks for the bug report. Will look at it tonight! |
Was able to repro with the draft PR as a e2e test. Here's the problem: ++ eval hadolint --no-fail --no-color '' -f json test/fixtures/Dockerfile-warning
+++ hadolint --no-fail --no-color -f json test/fixtures/Dockerfile-warning
+ OUTPUT='[{"code":"DL3018","column":1,"file":"test/fixtures/Dockerfile-warning","level":"warning","line":3,"message":"Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`"}]'
+ echo 'hadolint_output=[{"code":"DL3018","column":1,"file":"test/fixtures/Dockerfile-warning","level":"warning","line":3,"message":"Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`"}] >> /dev/null'
hadolint_output=[{"code":"DL3018","column":1,"file":"test/fixtures/Dockerfile-warning","level":"warning","line":3,"message":"Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`"}] >> /dev/null Note: the e2e test is incorrect as well. |
Been chasing this for a bit. I believe that parsing |
Any update on this? |
Been busy with work; will make an re-attempt at the fix this week. Sorry for the delay. |
Sorry, is there any update on this? |
Produces:
Run echo "2.12.0"
echo "2.12.0"
echo "1.12.0"
echo ""
In other words: the
hadolint_output
output variable is empty, no matter whichoutput_format
is specified.It looks like it's being caused by:
hadolint-gh-action/lib/main.sh
Line 52 in 4683c5d
Possible solution:
change
echo "hadolint_output=${OUTPUT//$'\n'/'%0A'} >> \$GITHUB_OUTPUT"
to
echo "hadolint_output=${OUTPUT//$'\n'/'%0A'}" >> "${GITHUB_OUTPUT}"
The text was updated successfully, but these errors were encountered: