fix 0 and negative available in quantity search #508
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Branch Name Check | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
jobs: | |
branch_name_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract branch name | |
id: extract_branch | |
run: echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV | |
- name: Check branch name format | |
run: | | |
# Retrieve the branch name from the environment | |
BRANCH_NAME=$BRANCH_NAME | |
# Convert branch name to lowercase | |
BRANCH_NAME_LOWER=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]') | |
echo "Branch name: $BRANCH_NAME_LOWER" | |
# Validate the lowercase branch name | |
if [[ "$BRANCH_NAME_LOWER" == "develop" ]]; then | |
echo "On develop branch. Validation passed." | |
exit 0 | |
fi | |
# Validate the lowercase branch name | |
if [[ ! "$BRANCH_NAME_LOWER" =~ ^(bugfix|feature|hotfix|chore|release|tests|doc|refactor)/issue-[0-9]+[/-][a-z0-9_-]+$ ]]; then | |
echo "Branch name $BRANCH_NAME_LOWER does not follow the required pattern: branch-type/issue-###/short-description" | |
echo "branch-type must be one of: bugfix, feature, hotfix, chore, release, test, doc, refactor" | |
exit 1 | |
fi |