Skip to content

Lint the entrypoint and the Dockerfile on every pull request - #38

Open
tigerblue77 wants to merge 1 commit into
ShaneMcC:masterfrom
tigerblue77:upstream/lint-ci
Open

tigerblue77 wants to merge 1 commit into
ShaneMcC:masterfrom
tigerblue77:upstream/lint-ci

Conversation

@tigerblue77

Copy link
Copy Markdown
Contributor

Nothing in this repository checked either file beyond whether they built. That is a weak test: docker/run.sh has held for six years and would still pass shellcheck's stricter POSIX family cleanly, but a future edit to it would not get that for free just because the file did once. Same for the Dockerfile — building it proves the layers resolve, not that they are written the way the image actually wants them.

Both jobs are green against master today, unmodified. Shellcheck reports nothing on docker/run.sh (-x so it follows a source/. the day the entrypoint ever grows one). Hadolint reports one finding, DL3041, on the single dnf install line that pulls in passwd/procps/kmod/tar/which/crypto-policies-scripts — silenced in .hadolint.yaml with a reason rather than worked around: this image does not pin OS package versions anywhere, on purpose, and the base image and its own repos are what "supported" tracks here, so a frozen NEVRA for six packages would need bumping by hand for no reason connected to this Dockerfile.

Both actions are pinned the way the rest of this repository's workflows already are — actions/checkout@v7.0.1, and hadolint/hadolint-action@v3.5.0 checked against that action's own tags rather than assumed, since it publishes no floating v3. Picked up automatically by the existing github-actions-all dependabot group; no new ecosystem entry needed.

One thing worth flagging myself: hadolint/hadolint-action always exports HADOLINT_FAILURE_THRESHOLD at its own info default whatever the step's input, but hadolint 2.15.1's own precedence is CLI > config file > environment, so .hadolint.yaml's warning still wins — confirmed against this action's pinned binary rather than assumed. Documented in the workflow so nobody "fixes" it by adding a failure-threshold input, which would just duplicate the config and hide the real value from a local hadolint Dockerfile run.

Assisted-by: Claude
Signed-off-by: Tigerblue77 37409593+tigerblue77@users.noreply.github.com

Until now nothing in this repository checked either file beyond whether they
built. That is a weak test: `docker/run.sh` has held for six years and would
still pass shellcheck's stricter POSIX family cleanly, but a future edit to it
would not get that for free just because the file did once. Same for the
Dockerfile — building it proves the layers resolve, not that they are written
the way the image actually wants them.

Both linters run clean against what is on master today: shellcheck reports
nothing on `docker/run.sh` (`-x` for when it ever starts sourcing something),
and hadolint reports one warning, DL3041, on the single `dnf install` line
that pulls in `passwd`/`procps`/`kmod`/`tar`/`which`/`crypto-policies-scripts`.
That one is silenced in `.hadolint.yaml` with a reason rather than worked
around: this image does not pin OS package versions anywhere, on purpose, and
the base image and its own repos are what "supported" tracks here — a frozen
NEVRA for six packages would need bumping by hand for no reason connected to
this Dockerfile.

Both jobs are pinned the same way the rest of the workflows in this repository
already are — `actions/checkout@v7.0.1`, `hadolint/hadolint-action@v3.5.0`
checked against that action's own tags rather than assumed — and picked up
automatically by the existing `github-actions-all` dependabot group, no new
ecosystem entry needed.

Assisted-by: Claude
Signed-off-by: Tigerblue77 <37409593+tigerblue77@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant