Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 34890a0

Browse files
committed
ENH: Add CircleCI skip [skip circle] [skip azp] [skip appveyor] [skip actions]
1 parent ecbd9d5 commit 34890a0

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.circleci/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ commands:
2424
git pull --ff-only upstream "refs/pull/$(cat merge.txt)/merge";
2525
fi
2626
27+
check-skip:
28+
steps:
29+
- run:
30+
name: Check-skip
31+
command: |
32+
export COMMIT_MESSAGE=$(git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " ")
33+
echo "Got commit message:"
34+
echo "${COMMIT_MESSAGE}"
35+
if [[ -v CIRCLE_PULL_REQUEST ]] && ([[ "$COMMIT_MESSAGE" == *"[skip circle]"* ]] || [[ "$COMMIT_MESSAGE" == *"[circle skip]"* ]]); then
36+
echo "Skip detected, exiting job ${CIRCLE_JOB} for PR ${CIRCLE_PULL_REQUEST}."
37+
circleci-agent step halt;
38+
fi
39+
2740
apt-install:
2841
steps:
2942
- run:
@@ -139,6 +152,7 @@ jobs:
139152
- image: circleci/python:3.8
140153
steps:
141154
- checkout
155+
- check-skip
142156
- merge
143157

144158
- apt-install

doc/devel/coding_guide.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,17 @@ will run on all supported platforms and versions of Python.
219219

220220
.. _tox: https://tox.readthedocs.io/
221221

222+
* If you know your changes do not need to be tested (this is very rare!), all
223+
CIs can be skipped by including ``[ci skip]`` or ``[skip ci]`` in your
224+
commit message. If you know only a subset of CIs need to be run (e.g.,
225+
if you are changing some block of plain reStructuredText and only want
226+
only CircleCI to run to render the result), individual CIs can be skipped
227+
to save bandwidth using:
228+
229+
- GitHub Actions: ``[skip actions]``
230+
- AppVeyor: ``[skip appveyor]``
231+
- Azure Pipelines: ``[skip azp]``
232+
- CircleCI: ``[skip circle]``
222233

223234
.. _pr-squashing:
224235

0 commit comments

Comments
 (0)