add changelog update check

This commit is contained in:
JAremko 2019-04-03 07:23:55 +03:00 committed by Sylvain Benner
parent 0becb67c21
commit cd27276b29
3 changed files with 50 additions and 13 deletions

28
.circleci/PR_changelong Executable file
View File

@ -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

View File

@ -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"

View File

@ -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 </tmp/changed_files
echo_headline "CHANGED FILES:"
cat /tmp/changed_files