Skip to content

Commit

Permalink
workflow: update git hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Konano committed Jan 27, 2022
1 parent 0bce24c commit ea70f51
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .github/git-hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

COMMIT_MESSAGE=`cat $1`
COMMIT_RE="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|release|hotfix|workflow|update)(\(.+\))?: .{1,100}"
MERGE_RE="^Merge branch"
MERGE_RE="^Merge "

if [[ ! $COMMIT_MESSAGE =~ $COMMIT_RE ]] && [[ ! $COMMIT_MESSAGE =~ $MERGE_RE ]]
then
Expand Down
2 changes: 1 addition & 1 deletion .github/gitflow-hooks/filter-flow-hotfix-start-version
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# VERSION=$1

VERSION=$1
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$"
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(a[1-9][0-9]*)?$"
if [[ ! $VERSION =~ $VERSION_RE ]]
then
# echo "Illegal version format: $VERSION"
Expand Down
2 changes: 1 addition & 1 deletion .github/gitflow-hooks/filter-flow-release-start-version
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# VERSION=$1

VERSION=$1
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$"
VERSION_RE="^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(a[1-9][0-9]*)?$"
if [[ ! $VERSION =~ $VERSION_RE ]]
then
# echo "Illegal version format: $VERSION"
Expand Down
26 changes: 0 additions & 26 deletions .github/gitflow-hooks/post-flow-release-start

This file was deleted.

7 changes: 2 additions & 5 deletions .github/gitflow-hooks/pre-flow-hotfix-finish
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# Positional arguments:
# $1 The version (including the version prefix)
# $2 The origin remote
# $3 The full branch name (including the feature prefix)
# $4 The base from which this feature is started
# $3 The full branch name (including the hotfix prefix)
# $4 The base from which this hotfix is started
#
# The following variables are available as they are exported by git-flow:
#
Expand All @@ -22,8 +22,5 @@ ROOT=`git rev-parse --show-toplevel`
VERSION=${1:1}

sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py"
cp "$ROOT/doc/CHANGELOG/hotfix.md" "$ROOT/doc/CHANGELOG/$VERSION.md"
node "$ROOT/doc/CHANGELOG/$VERSION.md"
git add "$ROOT/arknights_mower/__init__.py"
git add "$ROOT/doc/CHANGELOG/$VERSION.md"
git commit -m "hotfix: v$VERSION"
23 changes: 0 additions & 23 deletions .github/gitflow-hooks/pre-flow-release-delete

This file was deleted.

2 changes: 1 addition & 1 deletion .github/gitflow-hooks/pre-flow-release-finish
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
ROOT=`git rev-parse --show-toplevel`
VERSION=${1:1}

sed -i "s/__version__ = '[0-9\.a]\+'/__version__ = '$VERSION'/g" "$ROOT/arknights_mower/__init__.py"
git add "$ROOT/arknights_mower/__init__.py"
git add "$ROOT/doc/CHANGELOG/$VERSION.md"
git commit -m "release: v$VERSION"

0 comments on commit ea70f51

Please sign in to comment.