diff --git a/.travis/changelog.sh b/.travis/changelog.sh index 82fc3e7ac..b6a346335 100755 --- a/.travis/changelog.sh +++ b/.travis/changelog.sh @@ -6,28 +6,32 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=_shared-vars.sh . "${DIR}/_shared-vars.sh" +echo +echo "+++ Check if changelog was updated +++" +echo + if [[ ${TRAVIS_PULL_REQUEST} == false ]]; then - echo -e "${GREEN}+ Skip changelog check (no pull request)" + echo -e "${GREEN}+ Skip changelog check (no pull request)${NC}" exit 0; fi if [[ ${TRAVIS_PULL_REQUEST_BRANCH} =~ ^dependabot/npm_and_yarn/(.+)$ ]]; then - echo -e "${GREEN}+ Skip changelog check (dependency update)" + echo -e "${GREEN}+ Skip changelog check (dependency update)${NC}" exit 0; fi if [[ ${TRAVIS_BRANCH} == "develop" ]]; then echo "+ Pull Request from ${TRAVIS_PULL_REQUEST_BRANCH} to ${TRAVIS_BRANCH}" - curl --silent https://raw.githubusercontent.com/geli-lms/geli/"${TRAVIS_BRANCH}"/CHANGELOG.md \ + curl --silent "https://raw.githubusercontent.com/geli-lms/geli/${TRAVIS_BRANCH}/CHANGELOG.md" \ | diff CHANGELOG.md - \ | grep -P '^< - .{8,}' - -q RESULT=$?; if [[ ${RESULT} -eq 0 ]]; then - echo -e "${GREEN}+ Update in CHANGELOG.md found" + echo -e "${GREEN}+ Update in CHANGELOG.md found${NC}" exit 0 else - echo -e "${RED}+ ERROR: No Update in CHANGELOG.md found!" + echo -e "${RED}+ ERROR: No Update in CHANGELOG.md found!${NC}" echo "+ Please check if a line was added in the CHANGELOG.md." exit 1 fi @@ -35,21 +39,21 @@ fi if [[ ${TRAVIS_BRANCH} == "master" ]]; then echo "+ Pull Request from ${TRAVIS_PULL_REQUEST_BRANCH} to ${TRAVIS_BRANCH}" - curl --silent https://raw.githubusercontent.com/geli-lms/geli/"${TRAVIS_BRANCH}"/CHANGELOG.md \ + curl --silent "https://raw.githubusercontent.com/geli-lms/geli/${TRAVIS_BRANCH}/CHANGELOG.md" \ | diff CHANGELOG.md - \ | grep -P '^< ## \[\[\d{1,3}\.\d{1,3}\.\d{1,3}\].*\] - \d{4}-\d{2}-\d{2} - .{10,}' - -q RESULT=$?; if [[ ${RESULT} -eq 0 ]]; then - echo -e "${GREEN}+ Update in CHANGELOG.md found" + echo -e "${GREEN}+ Update in CHANGELOG.md found${NC}" exit 0 else - echo -e "${RED}+ ERROR: No Update in CHANGELOG.md found!" + echo -e "${RED}+ ERROR: No Update in CHANGELOG.md found!${NC}" echo "+ Please check if a new version was added in the CHANGELOG.md." echo "+ Or a new section for the next release was added." exit 1 fi fi -echo -e "${YELLOW}+ Pull Request but not against develop or master. No update for CHANGELOG.md required." +echo -e "${YELLOW}+ Pull Request but not against develop or master. No update for CHANGELOG.md required.${NC}" exit 0