-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (37 loc) · 1002 Bytes
/
linting.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
name: Linting
# Always run on Pull Requests as then these checks can be marked as required.
on:
push:
branches:
- master
pull_request:
permissions: {}
jobs:
shell-check:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Add error parser
run: echo -n "::add-matcher::shellcheck-matcher.json"
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
with:
format: gcc
linting-summary:
name: Linting Summary
runs-on: ubuntu-22.04
needs: [shell-check]
if: (!cancelled())
steps:
- name: Check if any job failed
run: |
if [[ -z "$(echo "${{ join(needs.*.result, '') }}" | sed -e 's/success//g')" ]]; then
echo "All jobs succeeded"
else
echo "One or more jobs did not succeed"
exit 1
fi