Closed mfn closed 2 years ago
Hope I'm not too late to help out.
ISSUE #3 contains a lot of conversation regarding this topic. You have several options:
HADOLINT_RECURSIVE
environment variable to true
seems to work somewhat (https://github.com/hadolint/hadolint-action/issues/3#issuecomment-1078208689)kgrv/hadolint
It can scan entire directories (including nested) with simple docker run
command
docker run --rm -v PATH:/workspace kgrv/hadolint
Integrate this into GitHub workflow with:
- name: Haskell Dockerfile Linter
run: docker run --rm -v ${PWD}:/workspace kgrv/hadolint
I hope this helps, cheers!
Ah,thanks! Totally forgot about this one.
I made a super-weird workaround:
name: Lint Docker files
on:
push:
paths:
- .github/workflows/docker_lint.yaml
- .hadolint.yaml
- Dockerfile*
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install hadolint
run: |
docker pull hadolint/hadolint:latest
container_id=$(docker create hadolint/hadolint)
docker cp $container_id:/bin/hadolint .
- run: ./hadolint --version
- run: ./hadolint Dockerfile*
Given what you wrote, it feels most natural to just go with https://github.com/jbergstroem/hadolint-gh-action to me, will check it out.
Since I could work it around already and more options are on the table and no one seems to work on the issues reporting here anyway -> closing!
Thanks 🙏🏼
With the version on the terminal, I can run it like so and get multiple files linted:
But with the action, I can't get it working:
produces
It acts like I would use single quotes in bash to prevent wildcard expansion: