Skip to content

Commit 35861db

Browse files
committed
ci: Add actionlint and hadolint for good measure
1 parent de13162 commit 35861db

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,35 @@ jobs:
3838
- name: Lint codebase with ruff
3939
run: |
4040
ruff check --preview --output-format github
41+
42+
actionlint:
43+
name: "Lint Github actions YAML files"
44+
# There's a way to add error formatting so GH actions adds messages to code,
45+
# but I can't work out the right number of quotes to get it to work
46+
# https://github.com/rhysd/actionlint/blob/main/docs/usage.md
47+
# #example-error-annotation-on-github-actions
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Check workflow files
52+
uses: docker://rhysd/actionlint:latest
53+
with:
54+
args: -color
55+
56+
dockerlint:
57+
name: "Lint dockerfiles"
58+
runs-on: ubuntu-latest
59+
container:
60+
image: hadolint/hadolint:latest-alpine
61+
env:
62+
HADOLINT_IGNORE: "DL3005,DL3007,DL3008,DL3015,DL3059"
63+
steps:
64+
- uses: actions/checkout@v3
65+
- name: Lint dockerfiles inside hadolint container
66+
run: |
67+
for DOCKERFILE in docker/Dockerfile.*; \
68+
do \
69+
echo " Linting $DOCKERFILE"; \
70+
hadolint "$DOCKERFILE" \
71+
|| exit 1; \
72+
done

0 commit comments

Comments
 (0)