I’m looking for a way not to launch jobs if the PR is documentation only.
After looking at some threads, we’ve recently set the following in place :
before_install:
- |
if ! git diff --name-only ${TRAVIS_COMMIT_RANGE} | grep -qvE '(\.md)$|^(Copyright)$|^(docs/)'
then
echo "Skipping CI build since we have docs-only changes for ${TRAVIS_COMMIT_RANGE} :"
git diff --name-only ${TRAVIS_COMMIT_RANGE}
exit
fi
However using this approach:
jobs are still triggered
they still take some time (APT update )
git checkout is done after update and then the check from above
Does anyone have a better strategy? Either reducing the jobs time or even better not launching them?