hadolint-action: Error: No hadolint failure but Actions job fails

No hadolint failure but Actions job fails when executing below actions.

Execution log

error

Actions yaml (part of hadolint job)

  lint-dockerfile:
    runs-on: ubuntu-20.04
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v3

      - name: hadolint (dockerfile linter)
        uses: hadolint/hadolint-action@f988afea3da57ee48710a9795b6bb677cc901183
        with:
          recursive: true

Workaround: Actions success when setting failure-threshold: "warning" option. But even if hadolint fails with info severity, Actions job will succeed😢.

error2

  lint-dockerfile:
    runs-on: ubuntu-20.04
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v3

      - name: hadolint (dockerfile linter)
        uses: hadolint/hadolint-action@f988afea3da57ee48710a9795b6bb677cc901183
        with:
          recursive: true
          failure-threshold: "warning"

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 8
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

The problem seems to be, that some errors/warnings/infos are not displayed in the log. I have a Dockerfile which doesn’t contain any ignore statements. In my first run, my .hadolint.yaml only contains the exclusion for DL3018. If I run Hadolint from CLI, I get the message:

Dockerfile:13 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

But in the CI, no message is displayed but the step fails.

If I add the exclusion for DL3059, the CI step succeeds.