Commit 6a673db1 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'docs-run-all-tests-when-vale-changes' into 'master'

Test all files if docs-lint config changes

See merge request gitlab-org/gitlab!48588
parents 7ff7a135 471703aa
...@@ -22,11 +22,13 @@ exceptions: ...@@ -22,11 +22,13 @@ exceptions:
- AWS - AWS
- BSD - BSD
- CLI - CLI
- CNA
- CNAME - CNAME
- CORE - CORE
- CPU - CPU
- CSS - CSS
- CSV - CSV
- CVE
- DAG - DAG
- DAST - DAST
- DHCP - DHCP
......
...@@ -65,11 +65,17 @@ then ...@@ -65,11 +65,17 @@ then
echo "Merge request pipeline (detached) detected. Testing all files." echo "Merge request pipeline (detached) detected. Testing all files."
else else
MERGE_BASE=$(git merge-base ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA} ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}) MERGE_BASE=$(git merge-base ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA} ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA})
if git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" | grep -E "\.vale|\.markdownlint|lint-doc\.sh"
then
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') MD_DOC_PATH=$(git diff --name-only "${MERGE_BASE}..${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}" 'doc/*.md')
if [ -n "${MD_DOC_PATH}" ] if [ -n "${MD_DOC_PATH}" ]
then then
echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}" echo -e "Merged results pipeline detected. Testing only the following files:\n${MD_DOC_PATH}"
fi fi
fi
fi fi
function run_locally_or_in_docker() { function run_locally_or_in_docker() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment