Skip to content

Commit

Permalink
Merge pull request #56 from bcnmy/chore/SMA-389-check-branch-update
Browse files Browse the repository at this point in the history
Chore/sma 389 check branch update
  • Loading branch information
AmanRaj1608 authored Nov 30, 2023
2 parents 33d5249 + 6d236f5 commit 8c85686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ Related Issue: # (issue number)
<!-- Any additional information or context about the PR. -->

# Branch Naming
<!-- Make sure your branch name follows the pattern: `features/`, `fixes/`, or `releases/`. -->
<!-- Make sure your branch name follows the pattern: `feat/`, `fix/`, `chore/` or `release/`. -->
<!-- **Note**: The person creating the PR is responsible for merging and deleting the branch. Ensure the code has been tested, commented, linted, and documents updated if needed. -->
6 changes: 3 additions & 3 deletions .github/workflows/check_branch_name.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
jobs:
check-branch-name:
runs-on: ubuntu-latest
if: github.event.ref_type == 'branch' && !contains(github.ref, 'refs/heads/main') && !contains(github.ref, 'refs/heads/develop')
if: github.event.ref_type == 'branch' && !contains(github.ref, 'refs/heads/main')
steps:
- name: Check Branch Name
run: |
BRANCH_PREFIX_REGEX="^(features/|fixes/|releases/).+"
BRANCH_PREFIX_REGEX="^(feat/|fix/|release/|chore/).+"
BRANCH_NAME=${GITHUB_REF#refs/heads/}
if [[ ! $BRANCH_NAME =~ $BRANCH_PREFIX_REGEX ]]; then
echo "Invalid branch name: $BRANCH_NAME"
echo "Branch name must start with 'features/', 'fixes/', or 'releases/'."
echo "Branch name must start with 'feat/', 'fix/', 'chore/', or 'release/'."
exit 1
fi

0 comments on commit 8c85686

Please sign in to comment.