Skip to content

Commit

Permalink
adding branch name security
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajlanclos committed Sep 11, 2024
1 parent 27dfc6f commit a6b5901
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/branch-name-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Branch Name Check

on:
push:
branches:
- '**' # Trigger on any branch push

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

steps:
- name: Check Branch Name
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
if [[ ! "$BRANCH_NAME" =~ ^(feature|bugfix|hotfix)/.+$ ]]; then
echo "Branch name '$BRANCH_NAME' does not match the required pattern."
exit 1
fi

0 comments on commit a6b5901

Please sign in to comment.