-
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.03 KB
/
shell-lint.yml
File metadata and controls
39 lines (39 loc) · 1.03 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
---
name: Lint for Shell
on:
workflow_call:
inputs:
search-path:
required: false
type: string
description: Path to search for files
default: .
runs-on:
required: false
type: string
description: Runner to use
default: ubuntu-slim
permissions:
contents: read
defaults:
run:
shell: bash -euo pipefail {0}
working-directory: .
jobs:
lint:
runs-on: ${{ inputs.runs-on }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 1
persist-credentials: false
- name: Install ShellCheck
run: |
sudo apt-get -y update
sudo apt-get -y install --no-install-recommends --no-install-suggests shellcheck
- name: Execute shellcheck
working-directory: ${{ inputs.search-path }}
run: >
git ls-files -z -- '*.sh' '*.bash' '*.bats'
| xargs -0 -t shellcheck --external-sources