File tree Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Expand file tree Collapse file tree 4 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ description : >
2+ If the first commit of the branch (where branch diverged from main/master)
3+ starts with 'chore:' all the following steps of the job will be skipped
4+ and the job finishes as succeeded
5+ steps :
6+ - checkout
7+ - run :
8+ name : Evaluate commit type
9+ command : |
10+ DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | cut -f 4 -d /)
11+ COMMIT_MESSAGE=$(git log $DEFAULT_BRANCH..$CIRCLE_SHA1 --format=%s | tail -1)
12+ echo "First commit: $COMMIT_MESSAGE"
13+ if [[ "${COMMIT_MESSAGE%:*}" == "chore" ]]; then
14+ echo "Skipping job for '${COMMIT_MESSAGE%:*}' commit type."
15+ circleci step halt
16+ else
17+ echo "Running job for '${COMMIT_MESSAGE%:*}' commit type."
18+ fi
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ executor:
33 name : testbed-machine
44resource_class : xlarge
55steps :
6+ - skip_on_chore_commit
67 - setup_environment :
78 machine : true
89 - build_docker_image
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ environment:
3838 USE_DEVSPACE : << parameters.use_devspace >>
3939resource_class : << parameters.resource_class >>
4040steps :
41+ - skip_on_chore_commit
4142 - setup_environment :
4243 machine : true
4344 - run :
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ parameters:
55executor :
66 name : testbed-docker
77steps :
8+ - skip_on_chore_commit
89 - setup_environment
910 - with_node_client_cache :
1011 save : true
You can’t perform that action at this time.
0 commit comments