-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (37 loc) · 1.14 KB
/
lint-check.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
name: lint-check
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
import_syntax_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check import syntax
run: |
EXITCODE=0
for file in $(find . -name '*.wdl'); do
>&2 echo "Checking file $file..."
import_lines=$(awk '/import/' "$file")
bad_lines=$(echo "$import_lines" | awk '/https:\/\/raw.githubusercontent.com\/stjude\/XenoCP/') || true
if [ -n "$bad_lines" ]; then
>&2 echo "Imports from this repo must use relative paths!"
>&2 echo "The following lines are bad:"
>&2 echo "$bad_lines"
>&2 echo ""
EXITCODE=1
fi
bad_lines=$(echo "$import_lines" | awk '/http/ && (/main/ || /master/)') || true
if [ -n "$bad_lines" ]; then
>&2 echo "Imports from external repos must use a tagged release!"
>&2 echo "The following lines are bad:"
>&2 echo "$bad_lines"
>&2 echo ""
EXITCODE=1
fi
done
exit $EXITCODE