Skip to content

hadolint-action builds out of turn #86

@anoronh4

Description

@anoronh4

i have a github action workflow where i want to start by maximizing the build space and then running all actions after. so my workflow has :

  dockerfile-validate-build:
    runs-on: ubuntu-latest
    name: dockerfile-build
    needs: [dockerfile-changes]
    if: needs.dockerfile-changes.outputs.docker-images != '[]'
    strategy:
      fail-fast: false
      matrix:
        tags: ["${{ fromJson(needs.dockerfile-changes.outputs.docker-images) }}"]
    steps:
      - name: Maximize build space
        uses: easimon/maximize-build-space@master
        with:
          build-mount-path: /var/lib/docker/
          remove-dotnet: 'true'
          remove-android: 'true'
          remove-haskell: 'true'
          remove-codeql: 'true'
      - name: Restart docker
        run: sudo service docker restart
      - name: Checkout
        uses: actions/checkout@v4
      - name: Hadolint
        uses: hadolint/hadolint-action@v3.1.0
        with:
          dockerfile: containers/${{ matrix.tags }}/Dockerfile
          verbose: true

However, for whatever reason, hadolint builds before any of the other steps. so after docker is restarted, the hadolint step runs and fails
Screenshot 2024-06-27 at 4 51 42 PM

It doesn't seem like i can control when hadolint gets built through the order of steps in my workflow. i was wondering why this is happening and how i can control the order of events here?

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