Files
hermes-agent/.github/workflows/docker-lint.yml
2026-10-15 05:23:51 -07:00

62 lines
2.2 KiB
YAML

name: Docker / shell lint
# Lints the container build inputs: Dockerfile (via hadolint) and any shell
# scripts under docker/ (via shellcheck). These catch the class of regression
# the behavioral docker smoke test can't — unquoted variable
# expansions, silently-failing RUN commands, etc.
#
# Rules and ignores are documented in .hadolint.yaml at the repo root.
# shellcheck severity is pinned to `error` so SC1091-style "can't follow
# sourced script" info-level warnings don't fail the job — the .venv
# activate script doesn't exist at lint time.
on:
workflow_call:
inputs:
commit:
description: Commit to test and build. Empty keeps the triggering commit.
type: string
default: ''
permissions:
contents: read
concurrency:
group: docker-lint-${{ (github.ref_type == 'tag' || inputs.commit != '') && github.run_id || github.ref }}
cancel-in-progress: ${{ github.ref_type != 'tag' && inputs.commit == '' }}
jobs:
lint-docker-and-shell:
name: Lint Dockerfile (hadolint)
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 5
steps:
- name: Checkout code
uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
with:
ref: ${{ inputs.commit }}
- name: Lint Dockerfile (hadolint)
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: Dockerfile
config: .hadolint.yaml
failure-threshold: warning
- name: Lint Dockerfile (hadolint, sandbox desktop image)
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
dockerfile: docker/sandbox-desktop.Dockerfile
config: .hadolint.yaml
failure-threshold: warning
- name: Lint shell scripts (shellcheck)
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # v2.0.0
env:
# Severity = error: SC1091 (can't follow sourced script) is info-
# level and would otherwise fail when the venv activate script
# doesn't exist at lint time.
SHELLCHECK_OPTS: --severity=error
with:
scandir: ./docker