From cd27276b29cf7b14804a6aee4feb0b9e276fade2 Mon Sep 17 00:00:00 2001 From: JAremko Date: Wed, 3 Apr 2019 07:23:55 +0300 Subject: [PATCH] add changelog update check --- .circleci/PR_changelong | 28 ++++++++++++++++++++++++++++ .circleci/config.yml | 20 ++++++++++++++++++-- .circleci/{validoc => }/select | 15 ++++----------- 3 files changed, 50 insertions(+), 13 deletions(-) create mode 100755 .circleci/PR_changelong rename .circleci/{validoc => }/select (79%) diff --git a/.circleci/PR_changelong b/.circleci/PR_changelong new file mode 100755 index 000000000..a858ed15e --- /dev/null +++ b/.circleci/PR_changelong @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +## This script ensures that changelog file was updated. +## +## Copyright (c) 2012-2014 Sylvain Benner +## Copyright (c) 2014-2018 Sylvain Benner & Contributors +## +## Author: Eugene Yaremenko +## URL: https://github.com/syl20bnr/spacemacs +## +## This file is not part of GNU Emacs. +## +## License: GPLv3 + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "${DIR}/shared" + +if [[ -z "${CIRCLE_PR_NUMBER// }" ]]; then + echo "Skipping changelogs check for branch update." + exit 0 +fi + +if grep -q CHANGELOG.develop /tmp/changed_files; then + echo "CHANGELOG.develop was updated as required" +else + echo "Please describe your commit in CHANGELOG.develop" + echo "See CONTRIBUTING.org for the details." + exit 1 +fi diff --git a/.circleci/config.yml b/.circleci/config.yml index ef9522a56..35f5ec3af 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,6 +120,19 @@ jobs: working_directory: ~/.emacs.d <<: *spacemacs_steps + "CHANGELOG.develop updated (optional)": + docker: + - image: jare/spacemacs-circleci:latest + working_directory: ~/.emacs.d + steps: + - checkout + - run: + name: Select changed files + command: ./.circleci/select + - run: + name: Check CHANGELOG.develop + command: ./.circleci/PR_changelong + "Validate Documentation (required)": docker: - image: jare/spacemacs-circleci:latest @@ -127,8 +140,8 @@ jobs: steps: - checkout - run: - name: Select changed documentation(.org) files - command: ./.circleci/validoc/select + name: Select changed files + command: ./.circleci/select - run: name: export changed documentation files for validation command: ./.circleci/validoc/export @@ -168,3 +181,6 @@ workflows: - "Validate Documentation (required)": requires: - "Validate PR" + - "CHANGELOG.develop updated (optional)": + requires: + - "Validate PR" diff --git a/.circleci/validoc/select b/.circleci/select similarity index 79% rename from .circleci/validoc/select rename to .circleci/select index 7badbdaf9..7fa28e357 100755 --- a/.circleci/validoc/select +++ b/.circleci/select @@ -1,5 +1,5 @@ #!/usr/bin/env bash -## This script selects changed .org files for validation. +## This script selects changed files. ## ## Copyright (c) 2012-2014 Sylvain Benner ## Copyright (c) 2014-2018 Sylvain Benner & Contributors @@ -12,7 +12,7 @@ ## License: GPLv3 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -source "${DIR}/../shared" +source "${DIR}/shared" if [[ -z "${CIRCLE_PR_NUMBER// }" ]]; then echo "Skipping documentation validation for branch update." @@ -42,12 +42,5 @@ if [ $? -ne 0 ]; then exit 1 fi -echo_headline "CHANGED DOCUMENTATION FILES:" -while read p -do - if [ -f "$p" ]; then - if [ ${p: -4} == ".org" ]; then - echo "${p}" - fi - fi -done