Use the official hadolint action for linting - #4804
Conversation
Replace the hand-rolled loop that pipes every Dockerfile into a hadolint container with hadolint/hadolint-action in recursive mode. The action lints **/Dockerfile in one run, reports real file paths instead of the stdin placeholder, and registers a problem matcher so findings are annotated inline on pull requests. Because the hadolint version now comes from the action, Dependabot keeps it up to date along with the other actions instead of the hand-maintained HADOLINT_VERSION variable, which is dropped. The bundled hadolint (v2.15.1) is much newer than the pinned v1.17.2 from 2019, so extend the ignore list with the style-level rules it reports on existing Dockerfiles: DL3025 (shell-form HEALTHCHECK CMDs, needed for the piped health probes), DL3029 (--platform in FROM, intentional in silabs-multiprotocol), DL3059 and DL3066 (info), and SC3010. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe lint workflow removes the manual Hadolint Docker loop and uses the pinned Hadolint action for recursive scanning. The Hadolint configuration adds five ignored rules. ChangesHadolint linting
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR replaces the Dockerfile linting loop with the pinned official action and updates lint rules; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Supersedes #4802, implementing @sairon's suggestion there.
What this PR changes
hadolint/hadolintcontainer over stdin) withhadolint/hadolint-actioninrecursive: truemode, which lints**/Dockerfilein a single run.HADOLINT_VERSIONenv var — the hadolint version now comes bundled with the action..hadolint.yamlwith the style-level rules the much newer bundled hadolint reports on existing Dockerfiles.Why
The pinned hadolint was v1.17.2 (2019), which rejects
HEALTHCHECK --start-interval(needed by #4800 / #4801) with a parse error. Beyond just bumping the version, using the official action brings three things the loop cannot:github-actions, so the action — and therefore hadolint — gets update PRs automatically instead of the version silently aging six years./dev/stdin:60:71; the action reportswhisper/Dockerfile:60.The action is pinned by SHA with a version comment, matching the other actions in this workflow.
Ignore-list additions
Bundled hadolint is v2.15.1 vs the previous v1.17.2, so it knows many more rules. All additions are style/info level:
DL3025HEALTHCHECK CMD— required for the pipednc | grephealth probesDL3029--platforminFROM— intentional in silabs-multiprotocol's cross-buildDL3059RUNinstructions (info)DL3066SC3010[[ ]]in a script hadolint treats as POSIX shTesting
Ran the action's actual entrypoint and bundled image locally against this branch:
path/Dockerfile:lineprefixes.yamllintclean on the modified workflow.🤖 Generated with Claude Code
Summary by CodeRabbit