Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
check-circle

GitHub Action

Shell Linter

v0.4.0

Shell Linter

check-circle

Shell Linter

Execute lint check on shell scripts using ShellCheck

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Shell Linter

uses: azohra/shell-linter@v0.4.0

Learn more about this action in azohra/shell-linter

Choose a version

Shell Linter

Release Marketplace Actions Status

A GitHub Action that performs static analysis for shell scripts using ShellCheck.


Usage

Shell Linter can perform static analysis in various ways. You can use it to lint all the shell scripts in your project or lint a specific file or folder using the path parameter. Specific use cases are shown below:

Run static analysis for all shell scripts in your repository:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
      - uses: actions/checkout@v1
      - name: Run Shellcheck
        uses: azohra/shell-linter@latest

Run static analysis for a single shell script:

      - name: Run Shellcheck
        uses: azohra/shell-linter@latest
        with:
          path: "setup.sh"

Run static analysis for multiple shell scripts with or without extension:

      - name: Run Shellcheck
        uses: azohra/shell-linter@latest
        with:
          path: "setup,deploy.sh"

Run static analysis for all the shell scripts in a folder:

      - name: Run Shellcheck
        uses: azohra/shell-linter@latest
        with:
          path: "src"

Run static analysis using a wildcard path:

      - name: Run Shellcheck
        uses: azohra/shell-linter@latest
        with:
          path: "src/*.sh"

Run static analysis for all the shell scripts and only report issue with error severity:

      - name: Run Shellcheck
        uses: azohra/shell-linter@latest
        with:
          path: "src/*.sh"
          severity: "error"

Run analysis by using a specific version of Shell Linter:

      - name: Run Shellcheck
        uses: azohra/shell-linter@v0.4.0

Input

path

Optional. Execute lint check on a specific file or folder. Default: .

severity

Optional. Specify minimum severity of errors to consider [style, info, warning, error]. Default: style

License

This software is available as open source under the terms of the MIT License.