mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add advanced Gitlab CI example (lint all shell scripts in git project)
13
GitLab-CI.md
13
GitLab-CI.md
@@ -7,3 +7,16 @@ test:
|
|||||||
script:
|
script:
|
||||||
- shellcheck testScript.sh
|
- shellcheck testScript.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Here is a CI job that will lint all shell scripts in a git repository:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
test:
|
||||||
|
image: koalaman/shellcheck-alpine:latest
|
||||||
|
stage: test
|
||||||
|
before_script:
|
||||||
|
- apk update
|
||||||
|
- apk add git
|
||||||
|
script:
|
||||||
|
- git ls-files --exclude='*.sh' --ignored | xargs shellcheck
|
||||||
|
```
|
Reference in New Issue
Block a user