Files
nextcloud/.github/workflows/docker-lint.yml
T
2026-08-22 11:16:58 +02:00

47 lines
1.3 KiB
YAML

name: Docker Lint
on:
pull_request:
paths:
- 'Containers/**'
push:
branches:
- main
paths:
- 'Containers/**'
permissions:
contents: read
concurrency:
group: docker-lint-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
docker-lint:
runs-on: ubuntu-latest
name: docker-lint
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install hadolint
run: |
sudo wget https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -O /usr/bin/hadolint
sudo chmod +x /usr/bin/hadolint
- name: run lint
run: |
for file in $(find Containers -name "*Dockerfile"); do
# DL3018 warning: Pin versions in apk add. Instead of `apk add <package>` use `apk add <package>=<version>`
# DL3041 warning: Specify version with `dnf install -y <package>-<version>`.
# DL3066 info: Non-numeric user-id may not be resolvable by host system
hadolint "$file" --ignore DL3018 --ignore DL3041 --ignore DL3066 | tee -a hadolint.log
done
# hadolint only prints to console if it finds issues, so the workflow needs to fail if it printed something
if [ -s hadolint.log ]; then
exit 1
fi