File tree 1 file changed +27
-1
lines changed
1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,35 @@ concurrency:
21
21
cancel-in-progress : true
22
22
23
23
jobs :
24
- # Build job
24
+ check :
25
+ runs-on : ubuntu-latest
26
+ steps :
27
+ - name : Checkout
28
+ uses : actions/checkout@v3
29
+ - name : Test files
30
+ run : |
31
+ for s in $(find -type f -name "*.ics" -print); do
32
+ echo "::group::Test file $s";
33
+ echo "Make http request"
34
+ echo "::debug::$response"
35
+ response=$(curl -sS -F "jform[task]=validate" -F "jform[ical_file]=@$s" "https://icalendar.org/validator.html?json=1")
36
+ error_count=$(echo "$response" | jq '.totals.errors')
37
+ warning_count=$(echo "$response" | jq '.totals.warnings')
38
+ echo "File has $error_count errors and $warning_count warnings."
39
+ if [ "$error_count" -gt "0" ]; then
40
+ echo "::error title=Error found::$(echo "$response" | jq -r '.errors | map(.message) | join("\n")')"
41
+ exit 1
42
+ fi
43
+ if [ "$warning_count" -gt "0" ]; then
44
+ echo "::warning title=Warning found::$(echo "$response" | jq -r '.warnings | map(.message) | join("\n")')"
45
+ exit 2
46
+ fi
47
+ echo "::endgroup::"
48
+ done
49
+
25
50
build :
26
51
runs-on : ubuntu-latest
52
+ needs : check
27
53
steps :
28
54
- name : Checkout
29
55
uses : actions/checkout@v3
You can’t perform that action at this time.
0 commit comments