[Buildkite] Fix CI docs bypass by ensuring HEAD diff for master is correct (#699)

This commit is contained in:
Amir Zarrinkafsh 2020-03-09 17:45:15 +11:00 committed by GitHub
parent 7a0d217b67
commit 6af27cb3f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -1,9 +1,15 @@
#!/bin/bash #!/bin/bash
set -u 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 cat << EOF
env: 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: steps:
- label: ":docker: Image Deployments" - label: ":docker: Image Deployments"

View File

@ -1,9 +1,15 @@
#!/bin/bash #!/bin/bash
set -u 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 cat << EOF
env: 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: steps:
- label: ":hammer_and_wrench: Unit Test" - label: ":hammer_and_wrench: Unit Test"