-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
executable file
·47 lines (40 loc) · 1023 Bytes
/
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
#!/bin/bash
RESULT=$(go list -u -mod=readonly -m -f '
{{if not .Indirect}}
{{if .Replace}}
{{if .Replace.Update}}
{{.}}
{{end}}
{{else}}
{{if .Update}}
{{.}}
{{end}}
{{end}}
{{end}}' all | sed -r 's/^\s*//;/^$/d')
echo
echo
echo "Result before filtering ignored dependencies:"
echo "$RESULT"
echo
echo
while read line ; do
if [ "$line" != "" ]
then
echo "$line is ignored"
DEP_TO_IGNORE=$(echo "$line" | sed -r 's|/|\\/|g')
NEW_RESULT=$(echo "$RESULT" | sed -r '/^'"$DEP_TO_IGNORE"'\s.*/d')
RESULT=$NEW_RESULT
fi
done < <(echo "$IGNORED_DEPENDENCIES")
if [ -n "$RESULT" ]
then
echo "There is some outdated dependencies:"
echo "$RESULT"
RESULT="${RESULT//'%'/'%25'}"
RESULT="${RESULT//$'\n'/'%0A'}"
RESULT="${RESULT//$'\r'/'%0D'}"
echo "::set-output name=is-up-to-date::false"
echo "::set-output name=outdated::$RESULT"
else
echo "::set-output name=is-up-to-date::true"
fi