Skip to content

Commit 8f72b63

Browse files
committed
updates
1 parent 8046725 commit 8f72b63

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/user-guide/examples/gitlab-ci.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ code_quality:
1313
- apk update && apk add git jq
1414
- vale sync # Pull down VRH rules package specified in vale.ini
1515
script:
16-
# List of updated/modified *.adoc files
17-
- FILES=$(find . -type f -name "*.adoc")
16+
# Get list of *.adoc files
17+
- |
18+
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
19+
FILES=$(find . -type f -name "*.adoc")
20+
else
21+
FILES=$(git diff --name-only HEAD~1 HEAD --diff-filter=d "*.adoc")
22+
fi
1823
# Clean out conditions for wider vale coverage
1924
- sed -i -e 's/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' ${FILES}
2025
# Use a template to rearrange the vale JSON output
2126
# Run vale with --no-exit to pass the build with errors
2227
- vale ${FILES} --minAlertLevel=error --glob='*.adoc' --output="$(pwd)/vale-json.tmpl" | jq . > gl-code-quality-report.json
23-
- echo $CI_DEFAULT_BRANCH
2428
artifacts:
2529
reports:
2630
codequality: gl-code-quality-report.json

0 commit comments

Comments
 (0)