GitXplorerGitXplorer
j

hadolint-gh-action

public
12 stars
5 forks
5 issues

Commits

List of commits on branch main.
Unverified
c9a5368465b571ed82a98119dc9ac124ca25a17a

chore(deps): oven-sh/setup-bun v2

rrenovate[bot] committed 3 months ago
Unverified
dc948d6be9ad10df2497ae7171e8007e901e5a8c

chore(deps): all non-major dependencies

rrenovate[bot] committed 16 days ago
Unverified
09cf374a12ff80d4e700651689f2383058c8e380

chore(deps): all non-major dependencies

rrenovate[bot] committed 4 months ago
Unverified
42cf04ee05183b0cc8ca3c3e82c5f9e63d6b1d84

chore(deps): crate-ci/typos v1.20.4

rrenovate[bot] committed 5 months ago
Unverified
aeb367e96d12aa71fa04a0373406ea2af7e586a0

chore(deps): crate-ci/typos v1.20.3

rrenovate[bot] committed 6 months ago
Unverified
e95e156a99def22f900ce91f085a9f85b96075a8

chore(deps): all non-major dependencies

rrenovate[bot] committed 6 months ago

README

The README file for this repository.

hadolint-gh-action

A stable, well-tested, highly configurable way of checking your Dockerfile(s) with hadolint.

Usage

Verify your dockerfiles with hadolint for pull requests:

name: Lint
on: pull_request

jobs:
  hadolint:
    runs-on: ubuntu-22.04
    name: Hadolint
    steps:
      - uses: actions/checkout@v4
      - uses: jbergstroem/hadolint-gh-action@v1

More usage examples can be found in USAGE.md.

Parameters

Variable Default Description
dockerfile ./Dockerfile Path to Dockerfile(s). Accepts shell expansions (**/Dockerfile)
config_file Path to optional config (hadolint defaults to read ./hadolint.yml if it exists)
error_level 0 Fail CI based on hadolint output (-1: never, 0: error, 1: warning, 2: info)
annotate true Annotate code inline in the github PR viewer (true/false)
output_format Set output format (choose between tty, json, checkstyle, codeclimate, gitlab_codeclimate, gnu, codacy, sonarqube and sarif)
hadolint_path Absolute path to hadolint binary. If unset, it is assumed to exist in $PATH
version 2.12.0 Use a specific version of Hadolint

Hadolint version

The github action accepts an input - version - to switch/pin to a different version of hadolint.

The output variable hadolint_version will always contain what version the action is running. This can be useful in debugging scenarios where things "break" from one day to the other due to the action being updated.

The shell scripts are developed against the latest version available (which is the default value for the input).

Output

You can control the behavior of how hadolint presents its findings by configuring:

  • annotate: let feedback show inline in your code review
  • output_format: store the output in a variable you can pass on to other processing tools

If output_format is set, the github action variable hadolint_output will contain the output. You can choose what format you prefer depending on how you want to process the results.

These output variables are always populated:

  • hadolint_version: the version of hadolint used while running the action
  • hadolint_gh_action_version: the version of this action while running it

Robustness

Also known as "can I run this in production". The action itself is tested via CI for all its use cases as well as unit tests for each function. Additionally, shellcheck is run against all shell scripts. Releases are cut manually (for now) and the action will strictly follow semver with regards to breaking functionality or options.

Performance

Due to staying with bash we can avoid Docker-related performance penalties. Yet to be benchmarked, but it is likely on par or faster than other hadolint actions.