-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6564f90
commit 87190fe
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Bugfix Request | ||
|
||
#### JIRA ID | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Module | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Description | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Related Issues | ||
<!-- Link any related GitHub issues here --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Feature Request | ||
|
||
#### JIRA ID | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Module | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Description | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Related Issues | ||
<!-- Link any related GitHub issues here --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### Release Request | ||
|
||
#### JIRA ID | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Module | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### Description | ||
<!-- Provide a detailed description of the feature --> | ||
|
||
#### List of Features | ||
<!-- Link any related GitHub issues here --> | ||
|
||
#### List of Issues | ||
<!-- Link any related GitHub issues here --> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
# Get the current branch name | ||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
# Define the pattern | ||
PATTERN="^(FEATURE|BUGFIX|RELEASE)\/(HCMPRE|DPG|SN)-[0-9]{1,5}$" | ||
|
||
# Check if the branch name matches the pattern | ||
if [[ ! "$BRANCH_NAME" =~ $PATTERN ]]; then | ||
echo "Branch name '$BRANCH_NAME' does not follow the correct pattern:" | ||
echo " - FEATURE/HCMPRE-<TICKET_NO>" | ||
echo " - FEATURE/DPG-<TICKET_NO>" | ||
echo " - FEATURE/SN-<TICKET_NO>" | ||
echo " - BUGFIX/HCMPRE-<TICKET_NO>" | ||
echo " - BUGFIX/DPG-<TICKET_NO>" | ||
echo " - BUGFIX/SN-<TICKET_NO>" | ||
echo " - RELEASE/HCMPRE-<TICKET_NO>" | ||
echo " - RELEASE/DPG-<TICKET_NO>" | ||
echo "Where <TICKET_NO> is a number between 0 and 99999." | ||
exit 1 | ||
fi | ||
|
||
# If the pattern matches, allow the push | ||
exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Branch Name Validation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
validate-branch-name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Validate branch name | ||
run: | | ||
branch_name=$(echo "${GITHUB_REF#refs/heads/}") | ||
pattern="^(FEATURE|BUGFIX|RELEASE)\/(HCMPRE|DPG|SN)-[0-9]{1,5}$" | ||
if [[ ! "$branch_name" =~ $pattern ]]; then | ||
echo "Branch name '$branch_name' does not follow the correct pattern: FEATURE/HCMPRE-<TICKET_NO>, FEATURE/DPG-<TICKET_NO>, FEATURE/SN-<TICKET_NO>, BUGFIX/SN-<TICKET_NO>, BUGFIX/HCMPRE-<TICKET_NO>, or BUGFIX/DPG-<TICKET_NO> where x is a number between 0 and 99999" | ||
exit 1 | ||
fi |