Basic setup of the project.
This commit is contained in:
23
.github/workflows/ValidateBranchName.yml
vendored
Normal file
23
.github/workflows/ValidateBranchName.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
name: Validate Branch Name on Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
validate-branch-name-on-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Validate Branch Name on Pull Request
|
||||
run: |
|
||||
BRANCH_NAME=${GITHUB_HEAD_REF}
|
||||
if [[ ! "$BRANCH_NAME" =~ ^(feature\/|fix\/|refactoring\/|testing\/|dependabot\/|gh-pages) ]]; then
|
||||
echo "Invalid branch name: $BRANCH_NAME"
|
||||
echo "Branch name must start with 'feature/', 'fix/', 'refactoring/', 'testing/', dependabot/" or "gh-pages"
|
||||
exit 1
|
||||
fi
|
Reference in New Issue
Block a user