Skip to content

Shardbyte/shard-shellcheck

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shardbyte Logo

ShellCheck Action

GitHub Action for ShellCheck. Supports Linux and macOS on x86_64 and ARM64.

License: MIT Maintained


Basic Usage

on:
  push:
    branches:
      - main
  pull_request:

permissions:
  contents: read

jobs:
  shellcheck:
    name: ShellCheck
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: Shardbyte/shard-shellcheck@v1.0.0

Inputs

Input Default Description
version stable ShellCheck version to download. Any tag from the ShellCheck releases.
severity (all) Minimum severity to fail on: error, warning, info, style
format gcc Output format: checkstyle, diff, gcc, json, json1, quiet, tty
scandir . Directory to search for shell scripts
check_together (off) Run ShellCheck on all found files in a single invocation
ignore_paths (none) Space-separated paths to exclude
ignore_names (none) Space-separated filenames to exclude
additional_files (none) Space-separated extra filenames to include (e.g. run finish)

Outputs

Output Description
files Newline-separated list of shell scripts found and checked
options The ShellCheck options used

Examples

Pass ShellCheck flags via environment variable

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        env:
          SHELLCHECK_OPTS: -e SC2059 -e SC2034 -e SC1090

Fail only on errors (ignore warnings and style)

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          severity: error

Ignore specific paths and filenames

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          ignore_paths: >-
            vendor
            third_party
          ignore_names: legacy.sh

Scan a specific directory only

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          scandir: ./scripts

Check all files in a single invocation (resolves SC1090/SC1091 source errors)

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          check_together: 'yes'

Scan for additional non-standard filenames

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          additional_files: 'run finish'

Pin a specific ShellCheck version

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          version: v0.10.0

Use tty output format for richer log output

      - uses: Shardbyte/shard-shellcheck@v1.0.0
        with:
          format: tty

Platform Support

OS x86_64 ARM64
Linux
macOS

Built with ❤️ by Shardbyte

About

GitHub Action for ShellCheck.

Topics

Resources

License

Stars

Watchers

Forks

Contributors