Skip to content

Commit

Permalink
Add hadolint to ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 19, 2024
1 parent cdecbff commit da9a90d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
golang/1.22/jammy: 'golang/1.22/jammy/**'
golang/1.23/jammy: 'golang/1.23/jammy/**'
grafana/grafana-oss: 'grafana/grafana-oss/**'
hadolint: 'hadolint/**'
hashicorp/terraform: 'hashicorp/terraform/**'
jfrog/jfrog-cli: 'jfrog/jfrog-cli/**'
ldap-utils: 'ldap-utils/**'
Expand Down
12 changes: 12 additions & 0 deletions bin/run-lint-stage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -eu -o pipefail

json_data="$(docker buildx bake --print 2>/dev/null)"
first_build_target=$(echo "$json_data" | jq -r '.target | to_entries[0].value')
if echo "$first_build_target" | jq -e '.labels."dev.polymathrobotics.container-build-publish-action.run-lint-stage"' > /dev/null; then
run_lint_stage=$(echo "$first_build_target" | jq -r '.labels."dev.polymathrobotics.container-build-publish-action.run-lint-stage"')
echo "$run_lint_stage"
else
echo "true"
fi
2 changes: 2 additions & 0 deletions hadolint/docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ target "_common" {
"org.opencontainers.image.description" = "Dockerfile linter, validate inline bash, written in Haskell."
"org.opencontainers.image.title" = "${TAG_PREFIX}"
"org.opencontainers.image.created" = "${timestamp()}"
"dev.polymathrobotics.container-build-publish-action.run-test-stage" = "false"
"dev.polymathrobotics.container-build-publish-action.run-lint-stage" = "false"
}
}

Expand Down

0 comments on commit da9a90d

Please sign in to comment.