1
0
Fork 0
mirror of https://github.com/ludeeus/action-shellcheck.git synced 2024-08-16 10:09:53 +02:00
shellcheck/README.md

90 lines
1.8 KiB
Markdown
Raw Normal View History

2020-05-29 23:11:34 +02:00
# ShellCheck
2019-03-09 11:25:14 +01:00
2020-05-29 23:11:34 +02:00
_GitHub action for ShellCheck._
2019-03-09 11:25:14 +01:00
## Example
2020-05-29 23:11:34 +02:00
```yaml
on:
2020-05-29 23:11:34 +02:00
push:
branch:
- master
2019-03-09 11:25:14 +01:00
2020-05-29 23:11:34 +02:00
name: 'Trigger: Push action'
2019-03-09 11:25:14 +01:00
2020-05-29 23:11:34 +02:00
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
2019-03-09 11:25:14 +01:00
```
2020-05-29 23:11:34 +02:00
## Globally disable checks
To disable specific checks add it to a `SHELLCHECK_OPTS` env key in the job definition.
example:
```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC2059 -e SC2034 -e SC1090
```
2020-05-30 11:57:50 +02:00
2020-05-30 12:00:24 +02:00
## Ignore paths
2020-05-30 11:57:50 +02:00
You can use the `ignore` input to disable specific directories.
```text
sample structure:
sample/directory/with/files/toignore/test.sh
sample/directory/with/files/test.sh
```
example:
```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore: toignore
```
This will skip `sample/directory/with/files/toignore/test.sh`
## Minimum severity of errors to consider (error, warning, info, style)
You can use the `severity` input to not fail until specified severity is met, for example fail only if there are errors in scripts but ignore styling, info and warnings.
example:
```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error
```
## Run shellcheck with all paths in a single invocation
If you run into SC1090/SC1091 errors you may need to tell shellcheck to check
all files at once:
```yaml
...
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
check_together: 'yes'
```
This can turn into a problem if you have enough script files to overwhelm the
maximum argv length on your system.