armbian-build/.github/workflows/lint-scripts-pr.yml
Igor Pečovnik e04d91ee4b
Look for bash shebang from start of the line (#4918)
Signed-off-by: Igor <igor@armbian.com>
2023-03-08 09:34:55 +01:00

46 lines
899 B
YAML

name: Lint On Scripts
#
# Run ShellCheck on all scripts and generates report as build artefact
#
on:
workflow_dispatch:
pull_request:
types: [opened, reopened, edited, synchronize]
permissions:
contents: read
jobs:
Shellcheck:
name: Shell script analysis
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v35
- name: List all changed files
run: |
ret=0
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if grep -qE "^#\!/" $file; then
shellcheck --severity=error $file || ret=$?
fi
done
exit $ret