Skip to content

Commit d690dbc

Browse files
committed
ci: Add actionlint and hadolint for good measure
1 parent c067e2b commit d690dbc

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

0 commit comments

Comments
 (0)