Use lint from addon-example
This commit is contained in:
parent
3fd9654ec5
commit
6ddcf44d9c
65
.github/workflows/lint.yml
vendored
65
.github/workflows/lint.yml
vendored
@ -1,54 +1,41 @@
|
|||||||
---
|
|
||||||
# yamllint disable rule:truthy
|
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|
||||||
env:
|
|
||||||
HADOLINT_VERSION: v1.17.2
|
|
||||||
SHELLCHECK_OPTS: -e SC1008 -s bash
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
hadolint:
|
find:
|
||||||
|
name: Find add-ons
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: hadolint
|
outputs:
|
||||||
|
addons: ${{ steps.addons.outputs.addons_list }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the repository
|
- name: ⤵️ Check out code from GitHub
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
- name: Run linter
|
- name: 🔍 Find add-on directories
|
||||||
id: changed_files
|
id: addons
|
||||||
run: |
|
uses: home-assistant/actions/helpers/find-addons@master
|
||||||
shopt -s globstar
|
|
||||||
for dockerfile in **/Dockerfile; do
|
|
||||||
echo "Linting: $dockerfile"
|
|
||||||
docker run --rm -i \
|
|
||||||
-v $(pwd)/.hadolint.yaml:/.hadolint.yaml:ro \
|
|
||||||
hadolint/hadolint:${{ env.HADOLINT_VERSION }} < "$dockerfile"
|
|
||||||
done
|
|
||||||
|
|
||||||
yamllint:
|
lint:
|
||||||
|
name: Lint add-on ${{ matrix.path }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: YAMLLint
|
needs: find
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
path: ${{ fromJson(needs.find.outputs.addons) }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out the repository
|
- name: ⤵️ Check out code from GitHub
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3.3.0
|
||||||
|
|
||||||
- name: Run YAMLLint
|
- name: 🚀 Run Home Assistant Add-on Lint
|
||||||
uses: frenck/action-yamllint@v1.3
|
uses: frenck/action-addon-linter@v2.10
|
||||||
|
with:
|
||||||
shellcheck:
|
path: "./${{ matrix.path }}"
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: ShellCheck
|
|
||||||
steps:
|
|
||||||
- name: Check out the repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Run linter
|
|
||||||
uses: ludeeus/action-shellcheck@1.1.0
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user