Skip to content

Commit 48bd795

Browse files
committed
adjust val script
1 parent 9b8518c commit 48bd795

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- gem install asciidoctor asciidoctor-diagram rouge
2020
- pip3 install pyyaml aura.tar.gz
2121
script:
22-
# Fail if Asciidoctor encounters errors. Run only if there are modified AsciiDoc files
22+
# Fail if Asciidoctor encounters errors. Pass otherwise. Run only if there are modified AsciiDoc files
2323
- if ! [[ -z $(git diff --name-only HEAD~1 HEAD --diff-filter=d '*.adoc' ':(exclude)_unused_topics/*') ]]; then chmod +x ./scripts/check-asciidoctor-build.sh && ./scripts/check-asciidoctor-build.sh; fi
2424

2525
- stage: build

scripts/check-asciidoctor-build.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ check_updated_assemblies () {
2121
then
2222
# $UPDATED_ASSEMBLIES is the list of assemblies that contains changed modules
2323
UPDATED_ASSEMBLIES=$(grep -rnwl "$REPO_PATH" --include=\*.adoc --exclude-dir={snippets,modules} -e "$MODULES")
24+
# Exit 0 if there are no modified assemblies
25+
if [[ -z "${UPDATED_ASSEMBLIES}" ]]
26+
then
27+
exit 0
28+
fi
2429
# subtract $REPO_PATH from path with bash substring replacement
2530
UPDATED_ASSEMBLIES=${UPDATED_ASSEMBLIES//"$REPO_PATH/"/}
2631
fi
@@ -51,15 +56,15 @@ check_updated_assemblies () {
5156

5257
update_log () {
5358
echo ""
54-
echo "************************************************************************"
59+
echo "****************************************************************************"
5560
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 "Validating all AsciiDoc assemblies that are modifed by the pull request. 🕵"
62+
echo "All assemblies that include modifed modules are validated. 🙀"
63+
echo "This might include assemblies that are not in the pull request! 🤬"
64+
echo "Validation will fail with FAILED, ERROR, or WARNING messages. "
65+
echo "Correct all reported AsciiDoc errors to pass the validation build. 🤟"
6166
echo ""
62-
echo "************************************************************************"
67+
echo "****************************************************************************"
6368
echo ""
6469
}
6570

0 commit comments

Comments
 (0)