Fix CI config to check if branch is master before skipping (#9140)
Related to: https://github.com/influxdata/telegraf/pull/9076 In order to support skipping a job depending on file changes, only works on non-master branches. This pull requests updates the config to check the current branch.
This commit is contained in:
parent
1a86fd1a2d
commit
9d163f6a83
|
|
@ -27,11 +27,11 @@ executors:
|
||||||
commands:
|
commands:
|
||||||
check-changed-files-or-halt:
|
check-changed-files-or-halt:
|
||||||
steps:
|
steps:
|
||||||
- run: git diff master --name-only --no-color | egrep -e "^(\.circleci\/.*)|(.*\.(go|mod|sum))|Makefile$" || circleci step halt
|
- run: ./scripts/check-file-changes.sh
|
||||||
check-changed-files-or-halt-windows:
|
check-changed-files-or-halt-windows:
|
||||||
steps:
|
steps:
|
||||||
- run:
|
- run:
|
||||||
command: git diff master --name-only --no-color | egrep -e "^(\.circleci\/.*)|(.*\.(go|mod|sum))|Makefile$" || circleci step halt
|
command: ./scripts/check-file-changes.sh
|
||||||
shell: bash.exe
|
shell: bash.exe
|
||||||
test-go:
|
test-go:
|
||||||
parameters:
|
parameters:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
echo $BRANCH
|
||||||
|
if [[ "$BRANCH" != "master" ]]; then
|
||||||
|
git diff master --name-only --no-color | egrep -e "^(\.circleci\/.*)|(.*\.(go|mod|sum))|Makefile$" || circleci step halt;
|
||||||
|
fi
|
||||||
Loading…
Reference in New Issue