Open pascalgulikers opened 8 months ago
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 %0A
(newline escaping) might have changed in github actions.
Any update on this?
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: https://github.com/jbergstroem/hadolint-gh-action/blob/4683c5d968121c56e9488f204ee5002db792dd13/lib/main.sh#L52Possible solution: change
echo "hadolint_output=${OUTPUT//$'\n'/'%0A'} >> \$GITHUB_OUTPUT"
toecho "hadolint_output=${OUTPUT//$'\n'/'%0A'}" >> "${GITHUB_OUTPUT}"