|
5 | 5 | # ensure asciidoctor is installed
|
6 | 6 | if ! command -v asciidoctor &>/dev/null ;
|
7 | 7 | then
|
8 |
| - echo "Asciidoctor is not installed. Please install it and try again." |
| 8 | + echo "Asciidoctor is not installed. Please install it and try again. 👻" |
9 | 9 | exit 127
|
10 | 10 | fi
|
11 | 11 |
|
@@ -36,18 +36,38 @@ check_updated_assemblies () {
|
36 | 36 | # don't validate the assembly if it is not in a topic map
|
37 | 37 | if grep -rq "$PAGE" --include "*.yml" _topic_maps ; then
|
38 | 38 | # validate the assembly
|
39 |
| - echo "Validating $ASSEMBLY. Validation will fail with FAILED, ERROR, or WARNING messages..." |
40 |
| - asciidoctor "$ASSEMBLY" -a source-highlighter=rouge -a icons! -o /tmp/out.html -v --failure-level WARN --trace |
| 39 | + echo "Validating $ASSEMBLY ... 🚨" |
| 40 | + VALIDATION_ERROR=$(asciidoctor "$ASSEMBLY" -a source-highlighter=rouge -a icons! -o /tmp/out.html -v --failure-level WARN --trace) |
| 41 | + # check assemblies and fail if errors are reported |
| 42 | + if [[ -z "$VALIDATION_ERROR" ]]; |
| 43 | + then |
| 44 | + echo "No errors found! ✅" |
| 45 | + fi |
41 | 46 | else
|
42 |
| - echo "$ASSEMBLY is not in a topic_map" |
| 47 | + echo "$ASSEMBLY is not in a topic_map, skipping validation... 😙" |
43 | 48 | fi
|
44 | 49 | done
|
45 | 50 | }
|
46 | 51 |
|
| 52 | +update_log () { |
| 53 | + echo "" |
| 54 | + echo "************************************************************************" |
| 55 | + echo "" |
| 56 | + echo "Validating all AsciiDoc files that are included in the pull request. 🕵" |
| 57 | + echo "Other assemblies that include the modifed modules are also validated. 🙀" |
| 58 | + echo "This might include assemblies that are not in the pull request. 🤬" |
| 59 | + echo "Validation will fail with FAILED, ERROR, or WARNING messages. ❌" |
| 60 | + echo "Correct all reported AsciiDoc errors to pass the validation build. 🤟" |
| 61 | + echo "" |
| 62 | + echo "************************************************************************" |
| 63 | + echo "" |
| 64 | +} |
| 65 | + |
47 | 66 | # check assemblies and fail if errors are reported
|
48 | 67 | if [ -n "${FILES}" ] ;
|
49 | 68 | then
|
| 69 | + update_log |
50 | 70 | check_updated_assemblies
|
51 | 71 | else
|
52 |
| - echo "No modified AsciiDoc files found." |
| 72 | + echo "No modified AsciiDoc files found! 🥳" |
53 | 73 | fi
|
0 commit comments