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
- Host: GitHub
- URL: https://github.com/essentialkaos/shellcheck-action
- Owner: essentialkaos
- License: apache-2.0
- Created: 2021-08-21T10:06:07.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-03T20:51:17.000Z (8 months ago)
- Last Synced: 2025-04-23T02:14:17.328Z (7 months ago)
- Topics: github-action, github-action-shell, github-actions
- Homepage: https://kaos.sh/shellcheck-action
- Size: 24.4 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
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)