diff --git a/.buildkite/deployment.sh b/.buildkite/deployment.sh index cb0814050..e07073dce 100755 --- a/.buildkite/deployment.sh +++ b/.buildkite/deployment.sh @@ -1,9 +1,15 @@ #!/bin/bash set -u +if [[ $BUILDKITE_BRANCH == "master" ]]; then + CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) +else + CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) +fi + cat << EOF env: - CI_DOCS_BYPASS: $(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} steps: - label: ":docker: Image Deployments" diff --git a/.buildkite/pipeline.sh b/.buildkite/pipeline.sh index 50c01ad86..9a4e087fb 100755 --- a/.buildkite/pipeline.sh +++ b/.buildkite/pipeline.sh @@ -1,9 +1,15 @@ #!/bin/bash set -u +if [[ $BUILDKITE_BRANCH == "master" ]]; then + CI_DOCS_BYPASS=$(git diff --name-only HEAD~1 | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) +else + CI_DOCS_BYPASS=$(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) +fi + cat << EOF env: - CI_DOCS_BYPASS: $(git diff --name-only `git merge-base --fork-point origin/master` | sed -rn '/^docs\/.*/!{q1}' && echo true || echo false) + CI_DOCS_BYPASS: ${CI_DOCS_BYPASS} steps: - label: ":hammer_and_wrench: Unit Test"