Files
addons/.github/workflows/lint.yml
Stefan Agner c7a5f7c0aa Improve GitHub action (#2364)
* Add YAML linter

* Drop GitHub registry login as its not required at this point

* Add YAML document start marker

* Fix YAMLlint issues

* Fix YAMLlint issues in .github yaml files

* Fix YAMLlint issue in .github/dependabot.yml

* Remove .github/move.yml

* Set dependabot to weekly

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>

* Use YAML strip option where appropriate

* Fix multiline string

Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2022-04-11 09:00:11 +02:00

53 lines
1.1 KiB
YAML

---
# yamllint disable rule:truthy
name: Lint
env:
HADOLINT_VERSION: v1.17.2
SHELLCHECK_OPTS: -e SC1008 -s bash
on:
pull_request:
branches: ["master"]
push:
branches: ["master"]
jobs:
hadolint:
runs-on: ubuntu-latest
name: hadolint
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Run linter
id: changed_files
run: |
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:
runs-on: ubuntu-latest
name: YAMLLint
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Run YAMLLint
uses: frenck/action-yamllint@v1.1
shellcheck:
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