Skip to content

Commit 78a95b5

Browse files
committed
workflows: Add ShellCheck static analysis job
Signed-off-by: Loïc Minier <[email protected]>
1 parent ee2c2b3 commit 78a95b5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/shellcheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Static analysis of shell scripts with ShellCheck
2+
3+
on:
4+
# run on pull requests to the main branch
5+
pull_request:
6+
branches: [main]
7+
# run on pushes to the main branch
8+
push:
9+
branches: [main]
10+
11+
# only need permission to read repository; implicitely set all other
12+
# permissions to none
13+
permissions:
14+
contents: read
15+
16+
# cancel in progress builds for this workflow triggered by the same ref
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
shellcheck:
23+
name: Install and run ShellCheck on shell scripts
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Install ShellCheck
27+
run: sudo apt update && sudo apt -y install shellcheck
28+
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Run ShellCheck
34+
run: shellcheck scripts/*
35+

0 commit comments

Comments
 (0)