From 08931747cc2092734a794980ef13ff67e89a9d8b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 26 Nov 2020 18:09:18 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- scripts/lint-doc.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'scripts/lint-doc.sh') diff --git a/scripts/lint-doc.sh b/scripts/lint-doc.sh index 9ae6ce400da..7dac15c6314 100755 --- a/scripts/lint-doc.sh +++ b/scripts/lint-doc.sh @@ -65,10 +65,16 @@ then echo "Merge request pipeline (detached) detected. Testing all files." else MERGE_BASE=$(git merge-base ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA} ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}) - MD_DOC_PATH=$(git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" 'doc/*.md') - if [ -n "${MD_DOC_PATH}" ] + if git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" | grep -E "\.vale|\.markdownlint|lint-doc\.sh" then - echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}" + MD_DOC_PATH=${MD_DOC_PATH:-doc} + echo "Vale, Markdownlint, or lint-doc.sh configuration changed. Testing all files." + else + MD_DOC_PATH=$(git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" 'doc/*.md') + if [ -n "${MD_DOC_PATH}" ] + then + echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}" + fi fi fi -- cgit v1.2.3