Skip to content

Fix bug condition in mypy run stage #20

Fix bug condition in mypy run stage

Fix bug condition in mypy run stage #20

name: Branch Name Check
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- main
- 'client-*'
jobs:
check-branch-name:
runs-on: ubuntu-latest
steps:
- name: Check branch name for main
if: github.base_ref == 'main'
run: |
BRANCH_NAME="${{ github.head_ref }}"
echo "Source branch: $BRANCH_NAME"
echo "Target branch: ${{ github.base_ref }}"
if [[ $BRANCH_NAME == hotfix-* ]] || [[ $BRANCH_NAME == feature-* ]] || [[ $BRANCH_NAME == bugfix-* ]]; then
echo "Branch name is valid"
exit 0
else
echo "Invalid branch name for main pull request"
echo "Branch name must start with 'hotfix-', 'feature-', or 'bugfix-'"
exit 1
fi
- name: Check branch name for client branches
if: startsWith(github.base_ref, 'client-')
run: |
BRANCH_NAME="${{ github.head_ref }}"
echo "Source branch: $BRANCH_NAME"
echo "Target branch: ${{ github.base_ref }}"
if [[ $BRANCH_NAME == feature-* ]] || [[ $BRANCH_NAME == bugfix-* ]] || [[ $BRANCH_NAME == hotfix-* ]]; then
echo "Branch name is valid"
exit 0
else
echo "Invalid branch name for client pull request"
echo "Branch name must start with 'feature-', 'bugfix-', or 'hotfix-'"
exit 1
fi