Repository navigation
74 lines (71 loc) · 2.26 KB
/
Copy pathdocker-lint.yml
File metadata and controls
74 lines (71 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Docker lint
permissions:
contents: read
# Cancel workflow if there is a new change to the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
merge_group:
pull_request:
branches:
- main
paths:
- "**/Dockerfile*"
- "**/*.dockerfile"
- "monitored-stack/docker-compose.yml"
- "monitored-stack/.env.example"
- ".github/workflows/docker-lint.yml"
push:
branches:
- main
paths:
- "**/Dockerfile*"
- "**/*.dockerfile"
- "monitored-stack/docker-compose.yml"
- "monitored-stack/.env.example"
- ".github/workflows/docker-lint.yml"
jobs:
# Merge groups don't support path filters, so detect the relevant changes
# explicitly and skip the job when nothing relevant changed.
# https://github.com/community/community/discussions/45899
changes:
runs-on: ubuntu-slim
outputs:
changesFound: ${{ steps.filter.outputs.changesFound }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
changesFound:
- '**/Dockerfile*'
- '**/*.dockerfile'
- 'monitored-stack/docker-compose.yml'
- 'monitored-stack/.env.example'
- '.github/workflows/docker-lint.yml'
docker-lint:
needs: changes
if: ${{ needs.changes.outputs.changesFound == 'true' }}
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7
- name: validate compose file
run: |
cp monitored-stack/.env.example monitored-stack/.env
docker compose -f monitored-stack/docker-compose.yml config
- uses: hadolint/hadolint-action@v3.5.0
with:
dockerfile: "Dockerfile*"
recursive: true
# https://github.com/hadolint/hadolint/wiki/DL3008
# https://github.com/hadolint/hadolint/wiki/DL3018
ignore: DL3008,DL3018
- uses: hadolint/hadolint-action@v3.5.0
with:
dockerfile: "*.dockerfile"
recursive: true
# https://github.com/hadolint/hadolint/wiki/DL3008
# https://github.com/hadolint/hadolint/wiki/DL3018
ignore: DL3008,DL3018