1010fi
1111
1212# 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/* ' )
1414
1515REPO_PATH=$( git rev-parse --show-toplevel)
1616
@@ -28,9 +28,19 @@ check_updated_assemblies () {
2828 ASSEMBLIES=$( echo " $FILES " | awk ' !/modules\/(.*)\.adoc/' )
2929 # concatenate both lists and remove dupe entries
3030 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
3444}
3545
3646# check assemblies and fail if errors are reported
0 commit comments