From 24f0c2fe33e5f08dfa57a7f114ce666fb70b22a1 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Wed, 2 Dec 2020 07:06:45 -0800 Subject: [PATCH] [ci] skip doc jobs take #3 (#8885) * check that we get any match first * docs only * 2 docs only * add code * restore --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe009a0b57d..fe881970bb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,14 +12,14 @@ commands: name: docs-only changes skip check command: | # pipeline.git.base_revision is not always defined, so only proceed if all external vars are defined - if test -n "<< pipeline.git.base_revision >>" && test -n "<< pipeline.git.revision >>" + if test -n "<< pipeline.git.base_revision >>" && test -n "<< pipeline.git.revision >>" && test -n "$(git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >>)" then if git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >> | egrep -qv '\.(md|rst)$' then echo "Non-docs were modified in this PR, proceeding normally" else echo "Only docs were modified in this PR, quitting this job" - #circleci step halt + circleci step halt fi else echo "Can't perform skipping check w/o base_revision defined, continuing the job"