-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.07 KB
/
shellcheck.yml
File metadata and controls
50 lines (42 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
name: 'shellcheck'
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_call:
inputs:
enable-shellcheck:
required: false
type: boolean
permissions:
contents: read
jobs:
runShellCheck:
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ inputs.enable-shellcheck }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Run ShellCheck
run: |
echo "[INFO] shellcheck version: $(shellcheck --version)"
###############################################
# disable exit on error to allow shellcheck
# to run against all files
###############################################
set +e
declare -i status=0
while IFS= read -r -d '' file
do
shellcheck --format=gcc "$file";
status+=$?
done < <(find . -type f -name "*.sh")
echo "[INFO] Exit status is: ${status}"
exit ${status}