Skip to content

Commit

Permalink
add not testes workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MAfarrag committed Dec 25, 2023
1 parent e1f3c07 commit b3a7525
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/pull-request-naming-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Branch Name Validation

on:
pull_request:
types:
- opened
- synchronize

jobs:
branch-name-validation:
runs-on: ubuntu-latest

steps:
- name: Check Branch Name
run: |
# Define your branch name pattern using regex
modules="distributions|tools|sensitivity|plot|parameters|metrics|eva|confidence_interval"
pattern=f"^({modules})/(feature|bugfix|hotfix|release|docs)/[a-zA-Z0-9_-]+$"
branch_name=$(echo "${{ github.ref }}" | awk -F/ '{print $3}')
if [[ ! "${branch_name}" =~ ${pattern} ]]; then
echo "Branch name does not match the naming convention."
echo "Expected format: 'type/branch-name'"
exit 1
fi
shell: bash

0 comments on commit b3a7525

Please sign in to comment.