An open API service indexing awesome lists of open source software.

https://github.com/essentialkaos/shellcheck-action

GitHub action for checking scripts with Shellcheck
https://github.com/essentialkaos/shellcheck-action

github-action github-action-shell github-actions

Last synced: 7 months ago
JSON representation

GitHub action for checking scripts with Shellcheck

Awesome Lists containing this project

README

          


Action for checking scripts with [Shellcheck](https://github.com/koalaman/shellcheck).

### Usage

Create file `.github/workflows/shellcheck.yml`.

Add next code to it:

```yml
name: CI

on:
push:
branches: [master, develop]
pull_request:
branches: [master]

jobs:
Shellcheck:
name: Shellcheck
runs-on: ubuntu-latest

steps:
- name: Code checkout
uses: actions/checkout@v4

- name: Check scripts with Shellcheck
uses: essentialkaos/shellcheck-action@v1
with:
files: src/script1.sh src/script2.sh
severity: error
format: gcc
shell: dash

```

You can disable specific checks through environment variables:

```yml
- name: Check scripts with Shellcheck
uses: essentialkaos/shellcheck-action@v1
env:
SHELLCHECK_OPTS: -e SC1117 -e SC2034 -e SC2154
with:
files: src/script1.sh src/script2.sh
```

### Options

| Option | Description | Value |
|--------|-------------|--------|
| `files` | List of scripts for checking | _Paths_ |
| `version` | Version of Shellcheck | _Version in semver notation_ |
| `severity` | Minimum severity of errors to consider | _Severity_ |
| `format` | The output format for the results | `checkstyle`
`diff`
`gcc`
`json`
`json1`
`quiet`
`tty` |
| `shell` | Script dialect | `sh`
`bash`
`dash`
`ksh` |

### License

[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)