Skip to content

Commit

Permalink
πŸ”„ synced file(s) with OpenIMSDK/Open-IM-Server
Browse files Browse the repository at this point in the history
πŸ€– kubbot to synchronize the warehouse
  • Loading branch information
kubbot committed Jul 13, 2023
1 parent 9fdaebe commit 7cb1d0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
LC_ALL=C

local_branch="$(git rev-parse --abbrev-ref HEAD)"
valid_branch_regex="^(main|master|develop|release)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"
valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"

YELLOW="\e[93m"
GREEN="\e[32m"
Expand Down
11 changes: 11 additions & 0 deletions scripts/githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ GREEN="\e[32m"
RED="\e[31m"
ENDCOLOR="\e[0m"

local_branch="$(git rev-parse --abbrev-ref HEAD)"
valid_branch_regex="^(main|master|develop|release(-[a-zA-Z0-9._-]+)?)$|(feature|feat|openim|hotfix|test|bug|ci|cicd|style|)\/[a-z0-9._-]+$|^HEAD$"

printMessage() {
printf "${YELLOW}OpenIM : $1${ENDCOLOR}\n"
}
Expand Down Expand Up @@ -96,6 +99,14 @@ print_color "Added Files: ${added_files}" "${BACKGROUND_GREEN}"
print_color "Modified Files: ${modified_files}" "${BACKGROUND_GREEN}"
print_color "Deleted Files: ${deleted_files}" "${BACKGROUND_GREEN}"

if [[ ! $local_branch =~ $valid_branch_regex ]]
then
printError "There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex.
Your commit will be rejected. You should rename your branch to a valid name(feat/name OR bug/name) and try again."
printError "For more on this, read on: https://gist.github.com/cubxxw/126b72104ac0b0ca484c9db09c3e5694"
exit 1
fi

#
#printMessage "Running the Flutter analyzer"
#flutter analyze
Expand Down

0 comments on commit 7cb1d0c

Please sign in to comment.