-
Notifications
You must be signed in to change notification settings - Fork 30
50 lines (47 loc) · 1.47 KB
/
shellcheck.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
38
39
40
41
42
43
44
45
46
47
48
49
50
name: shellcheck
on:
pull_request:
push:
branches:
- master
jobs:
filter:
runs-on: ubuntu-latest
outputs:
filter: ${{ steps.filter.outputs.shell == 'true' || steps.filter.outputs.workflows == 'true' }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: .github/filters.yml
check:
needs: filter
if: ${{ needs.filter.outputs.filter == 'true' }}
name: Check shell scripts
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install shellcheck
run: |
mkdir $HOME/bin
cd $HOME/bin
curl -L https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.darwin.x86_64.tar.xz \
| xz -d | tar x
- name: Check e2e scripts
run: $HOME/bin/shellcheck-v0.7.1/shellcheck e2e/bash/**/*.bash
- name: Check provision scripts
run: $HOME/bin/shellcheck-v0.7.1/shellcheck .github/workflows/*.sh
- name: Check wallet build script
run: $HOME/bin/shellcheck-v0.7.1/shellcheck wallet/build.sh
- name: Check demo script
run: $HOME/bin/shellcheck-v0.7.1/shellcheck demo.sh
aggregate:
name: shellcheck:required
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [check, filter]
steps:
- name: Check shellcheck result
if: ${{ needs.check.result != 'success' && needs.filter.outputs.filter == 'true' }}
run: exit 1