forked from armbian/build
-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (28 loc) · 1.15 KB
/
lint-scripts-on-merge-request.yml
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
name: Lint scripts
on:
workflow_dispatch:
pull_request:
types: [review_requested, ready_for_review]
jobs:
Shellcheck:
name: Shell script analysis
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'Armbian' }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- 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 lib -type f -exec grep -Iq . {} \; -print); do shellcheck --format=diff $file; done;) 2> /dev/null > lib.diff || true
(for file in $(find packages -type f -exec grep -Iq . {} \; -print); do shellcheck --format=diff $file; done;) 2> /dev/null > packages.diff || true
(for file in $(find config -type f -exec grep -Iq . {} \; -print); do shellcheck --format=diff $file; done;) 2> /dev/null > config.diff || true
- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: Shellcheck
path: "*.diff"
if-no-files-found: ignore
retention-days: 14