Last active
February 2, 2021 05:10
-
-
Save alexislefebvre/597ad49e5f60e804ea2d45b73de9967d to your computer and use it in GitHub Desktop.
Skip builds on Travis CI with "[skip travis]"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: false | |
language: php | |
git: | |
depth: 5 | |
php: | |
- 7.0 | |
before_install: | |
- if echo "$TRAVIS_COMMIT_MESSAGE" | grep -F -q "[skip travis]" ; then echo "[skip travis] has been found, exiting" && exit 0 ; else echo "[skip travis] has not been found, continuing" ; fi | |
script: | |
- echo "OK, I should not see this" |
This doesn't work for skipping pull requests that have [skip travis] in the commit message.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update: use
$TRAVIS_COMMIT_MESSAGE
instead ofgit show -s HEAD
Source: travis-ci/travis-build#936