10
10
fi
11
11
12
12
# get the *.adoc modules and assemblies in the pull request
13
- FILES=$( git diff --name-only HEAD~1 HEAD --diff-filter=d " *.adoc" )
13
+ FILES=$( git diff --name-only HEAD~1 HEAD --diff-filter=d " *.adoc" ' :(exclude)_unused_topics/* ' )
14
14
15
15
REPO_PATH=$( git rev-parse --show-toplevel)
16
16
@@ -28,9 +28,19 @@ check_updated_assemblies () {
28
28
ASSEMBLIES=$( echo " $FILES " | awk ' !/modules\/(.*)\.adoc/' )
29
29
# concatenate both lists and remove dupe entries
30
30
ALL_ASSEMBLIES=$( echo " $UPDATED_ASSEMBLIES $ASSEMBLIES " | tr ' ' ' \n' | sort -u)
31
- # validate the assemblies
32
- echo " Validating updated assemblies. Validation will fail with FAILED, ERROR, or WARNING messages..."
33
- asciidoctor $ALL_ASSEMBLIES -a icons! -o /dev/null -v --failure-level WARN
31
+ # check that assemblies are in a topic_map
32
+ for ASSEMBLY in $ALL_ASSEMBLIES ; do
33
+ # get the page name to search the topic_map
34
+ PAGE=$( basename " $ASSEMBLY " .adoc)
35
+ # don't validate the assembly if it is not in a topic map
36
+ if grep -rq " $PAGE " --include " *.yml" _topic_maps ; then
37
+ # validate the assembly
38
+ echo " Validating $ASSEMBLY . Validation will fail with FAILED, ERROR, or WARNING messages..."
39
+ asciidoctor " $ASSEMBLY " -a icons! -o /dev/null -v --failure-level WARN
40
+ else
41
+ echo " $ASSEMBLY is not in a topic_map"
42
+ fi
43
+ done
34
44
}
35
45
36
46
# check assemblies and fail if errors are reported
0 commit comments