This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 91
101 lines (85 loc) · 2.4 KB
/
lint-checks.yaml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Lint Checks
on:
pull_request:
branches:
- main
- dev
push:
branches:
- dev
jobs:
check-addon-changes:
runs-on: ubuntu-latest
outputs:
changedAddons: ${{ steps.filter.outputs.changes }}
changedDockerfiles: ${{ steps.changed-files.outputs.dockerfile_files }}
steps:
- name: ↩️ Checkout
uses: actions/checkout@v4
- name: 📂 Detect chanced addons
uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/paths-filter.yml
- name: 📂 Detect chanced files
uses: dorny/paths-filter@v3
id: changed-files
with:
list-files: csv
filters: |
dockerfile:
- '**/Dockerfile.md'
addon-linter:
name: Addon linting
if: ${{ needs.check-addon-changes.outputs.changedAddons != '[]' }}
runs-on: ubuntu-latest
needs: check-addon-changes
strategy:
fail-fast: false
matrix:
addon: ${{ fromJSON(needs.check-addon-changes.outputs.changedAddons) }}
steps:
- name: ↩️ Checkout
uses: actions/checkout@v4
- name: 🔎 Run Home Assistant Add-on Lint
uses: frenck/action-addon-linter@v2
with:
path: "./${{ matrix.addon }}"
hadolint:
runs-on: ubuntu-latest
container: ghcr.io/hadolint/hadolint:latest-alpine
steps:
- name: ↩️ Checkout
uses: actions/checkout@v4
- name: 🔎 Run hadolint
if: steps.filter.outputs.dockerfile == 'true'
run: hadolint ${{ needs.check-addon-changes.outputs.changedDockerfiles }}
shellcheck:
runs-on: ubuntu-latest
steps:
- name: ↩️ Checkout
uses: actions/checkout@v4
- name: 📂 Detect chanced files
id: filter
uses: dorny/paths-filter@v3
with:
list-files: 'shell'
filters: |
shell:
- '**/*.sh'
- '**/cont-init.d/*'
- '**/services.d/*'
- name: 🔎 Run ShellCheck
if: steps.filter.outputs.shell == 'true'
uses: ludeeus/[email protected]
with:
additional_files: ${{ steps.filter.outputs.shell_files }}
markdownlint:
runs-on: ubuntu-latest
steps:
- name: ↩️ Checkout
uses: actions/checkout@v4
- name: 🔎 Run markdownlint
uses: nosborn/[email protected]
with:
files: .