Skip to content

failure-threshold: info causes outcome=failure but conclusion=success, workflow passes incorrectly #98

@masartz

Description

@masartz

Issue Description

When using failure-threshold: info, the hadolint-action reports outcome: failure but conclusion: success, causing GitHub Actions workflows to pass even when info-level violations are detected.

Expected Behavior

When failure-threshold: info is set and info-level violations are found, the action should:

  • Report outcome: failure
  • Report conclusion: failure
  • Cause the workflow to fail

Actual Behavior

The action reports:

  • outcome: failure
  • conclusion: success ✗ (should be failure)
  • Workflow passes ✗ (should fail)

Reproduction

Workflow Configuration

- name: Lint Dockerfiles
  id: hadolint
  uses: hadolint/hadolint-action@v3.3.0
  with:
      dockerfile: "docker/app/Dockerfile"
      failure-threshold: info

Dockerfile (with info-level violation)

FROM php:8.2-fpm-bullseye
RUN apt-get update && \
  apt-get -y install git unzip  # Missing --no-install-recommends (DL3015)

Workflow Results

Conclusion: success  # Should be failure
Outcome: failure     # Correct
HADOLINT_RESULTS: docker/app/Dockerfile:9 DL3015 info: Avoid additional packages by specifying `--no-install-recommends`

Verification

Running hadolint directly works as expected:

$ docker run --rm -i hadolint/hadolint:v2.14.0-debian hadolint --failure-threshold info - < Dockerfile
-:9 DL3015 info: Avoid additional packages by specifying `--no-install-recommends`
$ echo $?
1  # Correct: non-zero exit code

Environment

  • hadolint-action version: v3.3.0
  • hadolint version: v2.14.0-debian
  • GitHub Actions runner: ubuntu-latest

Additional Context

The discrepancy between outcome (failure) and conclusion (success) suggests the Docker container's exit code may not be properly propagated to the GitHub Actions step result.

Workaround

Use hadolint directly instead of the action:

- name: Lint Dockerfiles
  run: |
    docker run --rm -i hadolint/hadolint:v2.14.0-debian \
      hadolint --failure-threshold info - < docker/app/Dockerfile

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions