Skip to content

Instantly share code, notes, and snippets.

@alexislefebvre
Last active February 2, 2021 05:10
Show Gist options
  • Save alexislefebvre/597ad49e5f60e804ea2d45b73de9967d to your computer and use it in GitHub Desktop.
Save alexislefebvre/597ad49e5f60e804ea2d45b73de9967d to your computer and use it in GitHub Desktop.
Skip builds on Travis CI with "[skip travis]"
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"
@alexislefebvre
Copy link
Author

Update: use $TRAVIS_COMMIT_MESSAGE instead of git show -s HEAD

Source: travis-ci/travis-build#936

@bashtage
Copy link

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