armbian-build/.github/workflows/lint-scripts-pr.yml
2022-11-14 23:00:43 +01:00

41 lines
926 B
YAML

name: Lint On Scripts
#
# Run ShellCheck on all scripts and generates report as build artefact
#
on:
workflow_dispatch:
pull_request:
types: [review_requested, ready_for_review, 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:
ref: ${{ github.event.pull_request.head.sha }}
- name: Environment variables
run: sudo -E bash -c set
- name: "Shellcheck on changed files"
shell: bash {0}
run: |
for file in $(git diff --name-only master..HEAD); do
# We are only interested in BASH scripts
if grep -qE "#\!/" $file; then
shellcheck $file
fi
done