ci: move Dockerfile linting from Woodpecker to GitHub Actions - #83
Merged
Conversation
Runs hadolint as a PR-time GitHub Actions check instead of a Woodpecker step, so Dockerfile lint issues are caught before merge rather than at deploy time. Woodpecker's build-and-push no longer depends on a lint step.
curl -f already returns a non-zero exit code on HTTP error responses, so the shell-form '|| exit 1' was redundant. Switching to JSON array notation removes the need for a shell and satisfies hadolint's DL3025 check.
hadolint/hadolint-action@v3.4.0 bundles hadolint v2.15.0, which has a false positive (DL3066) on 'USER $UID' that's fixed in v2.15.1. Running hadolint/hadolint:latest-alpine directly (matching what Woodpecker used) avoids depending on the action's version lag.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the lint check to PR time (catches Dockerfile issues before merge) instead of at deploy time in Woodpecker (after merge, when a build attempt is already wasted).
Note: the existing DL3025 warning (
Use arguments JSON notation for CMD and ENTRYPOINT arguments) on Dockerfile:11 is not fixed here — this PR only relocates the lint stage, so the new GitHub Actions job will fail the same way Woodpecker currently does until that's addressed separately.Test plan