-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.07 KB
/
Copy pathshellcheck-privste.yml
File metadata and controls
40 lines (34 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
name: ShellCheck Private Scan
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
security-events: write
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get update && sudo apt-get install -y shellcheck
- name: Run ShellCheck on all .sh and save output
run: |
files=$(find . -type f -name "*.sh" -not -path "./.git/*" -print)
if [ -z "$files" ]; then
echo "No shell scripts found"
echo "NO_SCRIPTS" > shellcheck-output.txt
exit 0
fi
shellcheck $files > shellcheck-output.txt || true
shellcheck -f sarif $files > shellcheck-results.sarif || true
- name: Upload results as artifact (private to repo collaborators)
uses: actions/upload-artifact@v4
with:
name: shellcheck-results-${{ github.run_id }}
path: |
shellcheck-output.txt
shellcheck-results.sarif