-
Notifications
You must be signed in to change notification settings - Fork 1
/
entrypoint.sh
executable file
·69 lines (56 loc) · 1.53 KB
/
entrypoint.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
echo "===configuration==="
echo "lint: $INPUT_LINT"
echo "exceptions: $INPUT_EXCEPT"
echo "warnings: $INPUT_WARNINGS"
echo "notes: $INPUT_NOTES"
echo "patterns: $INPUT_PATTERNS"
lint=""
exceptions=""
if [ $INPUT_LINT = "true" ]; then
lint="--lint"
if [ -n "$INPUT_EXCEPT" ]; then
echo "Excepted rule(s) provided."
for exception in $(echo $INPUT_EXCEPT | sed 's/,/ /')
do
exceptions="$exceptions --except $exception"
done
fi
fi
warnings=""
if [ ${INPUT_WARNINGS} = "true" ]; then
warnings="--deny-warnings"
fi
notes=""
if [ ${INPUT_NOTES} = "true" ]; then
notes="--deny-notes"
fi
exclusions=${INPUT_PATTERNS}
if [ -n "$exclusions" ]; then
echo "Exclusions provided. Writing to .sprocket.yml."
echo -n "" > .sprocket.yml
for exclusion in $(echo $exclusions | sed 's/,/ /g')
do
echo "$exclusion" >> .sprocket.yml
done
echo " [***] Exclusions [***]"
cat .sprocket.yml
fi
EXITCODE=0
echo "Checking WDL files using \`sprocket lint\`."
for file in $(find $GITHUB_WORKSPACE -name "*.wdl")
do
if [ -e ".sprocket.yml" ]
then
if [ $(echo $file | grep -cvf .sprocket.yml) -eq 0 ]
then
echo " [***] Excluding $file [***]"
continue
fi
fi
echo " [***] $file [***]"
echo "sprocket check $lint $warnings $notes $exceptions $file"
sprocket check $lint $warnings $notes $exceptions $file || EXITCODE=$(($? || EXITCODE))
done
echo "status=$EXITCODE" >> $GITHUB_OUTPUT
exit $EXITCODE