Feature/linting (#19) #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint | |
on: [push] | |
jobs: | |
lint: | |
name: Run ShellCheck | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install ShellCheck | |
run: sudo apt-get install shellcheck | |
- name: Find shell scripts with \#!/bin/sh and run ShellCheck | |
run: | | |
files=$(find . -type f ! -path '*/\.*' -exec grep -lE '^#!(/usr)?/bin/sh' {} +) | |
if [ -n "$files" ]; then | |
shellcheck -a -S warning -s sh $files | |
else | |
echo "No shell scripts with #!/bin/sh shebang found." | |
fi |