Add automation for testing commands on multiple OS #325
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 scripts | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
Shellcheck: | |
name: Shell script analysis | |
runs-on: ubuntu-latest | |
if: ${{ github.repository_owner == 'Armbian' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Environment variables | |
run: sudo -E bash -c set | |
- name: "Shellcheck lint error report in diff format" | |
shell: bash {0} | |
run: | | |
for file in $(find . -type f -executable ! -path '*/.git*/*' -exec grep -Iq . {} \; -print); do | |
if grep -qE "^#\!/.*bash" $file; then | |
shellcheck --severity=error $file || ret=$? | |
fi | |
done | |
exit $ret |