Skip to content

CI — Shell

Runs ShellCheck → actionlint → Bats → Docker for shell script projects. Each stage is independently toggleable.

Usage

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-shell.yml@main
    with:
      run-shellcheck: true
      run-actionlint: true
      run-bats: true
      run-link-check: true
      link-check-paths: 'docs/**/*.md'
      run-docker: false

Inputs

InputTypeDefaultDescription
run-shellcheckbooleantrueRun ShellCheck on all .sh files
shellcheck-severitystringwarningMinimum severity: error | warning | info | style
shellcheck-exclude-pathsstring*/test_helper/*Glob passed to find -not -path to exclude from analysis
run-actionlintbooleantrueRun actionlint on GitHub Actions workflow files
actionlint-pathsstring.github/workflows/Space-separated paths to validate
actionlint-flagsstring''Extra flags passed to actionlint
run-batsbooleantrueRun Bats unit tests
bats-tests-dirstringtests/Directory (or file) containing .bats test files
bats-submodulesbooleantrueCheckout git submodules required by Bats helpers
run-dockerbooleanfalseRun Docker integration tests
docker-filestringtests/docker/Dockerfile.testPath to the test Dockerfile
docker-targetsstring'[]'JSON array of --target names to build (e.g. '["test-bats","test-init"]')

Jobs

JobCondition
shellcheckrun-shellcheck: true
validate-yamlrun-actionlint: true
batsrun-bats: true
docker-testrun-docker: true (matrix over docker-targets)
link-checkrun-link-check: true

Notes

  • Docker targets run in parallel via a matrix strategy with fail-fast: false.
  • The bats-submodules flag applies to both the bats and docker-test jobs.
  • ShellCheck and actionlint use their own composite actions: shellcheck, actionlint. actionlint covers YAML syntax, expression type checking, and action input validation — no separate yamllint needed.
  • link-check runs lychee in offline mode — no external HTTP requests are made.