A GitHub Action that lints shell scripts using ShellCheck.
This composite action finds all shell scripts (.sh and .bash files) in the specified path and validates them using ShellCheck. It reports any issues and fails if linting errors are found.
- name: Lint Shell Scripts uses: ./.github/actions/shellcheck-action
| Input | Description | Required | Default |
|---|---|---|---|
path | Path to search for shell scripts | No | . |
severity | Minimum severity level (error, warning, info, style) | No | style |
exclude | Comma-separated list of ShellCheck codes to exclude | No | "" |
name: Shell Script Lint on: pull_request: push: branches: - main jobs: shellcheck: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Lint shell scripts uses: ./.github/actions/shellcheck-action with: path: scripts severity: warning exclude: SC1090,SC2034
The action performs the following steps:
.sh and .bash files in the specified patherror - Only show errorswarning - Show errors and warningsinfo - Show errors, warnings, and informational messagesstyle - Show all issues including style suggestions (default)