forked from petervanderdoes/git-flow-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre-flow-feature-finish
executable file
·45 lines (36 loc) · 1006 Bytes
/
pre-flow-feature-finish
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#
# Runs before git flow feature finish
#
# Positional arguments:
# $1 The friendly name of the branch
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
#
NAME=$1
ORIGIN=$2
BRANCH=$3
# Implement your script here.
. "$HOOKS_DIR"/gitflow-functions
ROOTDIR=$(git rev-parse --show-toplevel)
gitflow_update_authors
# Prepare new version
# HOOKS_DIR is defined in gitflow-common.
CURRENT_VERSION=$(gitflow_get_current_version)
gitflow_set_major_minor $CURRENT_VERSION
gitflow_set_dev_release
gitflow_build_version
# If the branch names ends with _nr where nr is a number it adds the line Closes #nr
# This makes github automatically close that issue when the develop branch is pushed.
ISSUENR=$(echo ${NAME##*_})
if gitflow_validInt "$ISSUENR"; then
MESSAGE="Version bump $AVH_VERSION
Closes #$ISSUENR
"
else
MESSAGE=""
fi
gitflow_update_version $AVH_VERSION "$MESSAGE"
#Clean up
# To terminate the git-flow action, return a non-zero exit code.
exit 0