-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcheck-version-bump.sh
More file actions
executable file
·27 lines (22 loc) · 963 Bytes
/
check-version-bump.sh
File metadata and controls
executable file
·27 lines (22 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/env bash
VERSION_CHANGE_TRIGGERS="setup.py MANIFEST.in openfisca_extension_template"
if git diff-index --quiet origin/master -- $VERSION_CHANGE_TRIGGERS ":(exclude)*.md"
then exit 0 # there are no changes at all, the version is correct
fi
current_version=`python setup.py --version`
if git rev-parse --verify --quiet $current_version
then
echo "Version $current_version already exists:"
git --no-pager log -1 $current_version
echo
echo "Update the version number in setup.py before merging this branch into master."
echo "Look at the CONTRIBUTING.md file to learn how the version number should be updated."
exit 1
fi
if git diff-index --quiet origin/master CHANGELOG.md
then
echo "CHANGELOG.md has not been modified, while the code has changed."
echo "Explain what you changed before merging this branch into master."
echo "Look at the CONTRIBUTING.md file to learn how to write the changelog."
exit 2
fi