Skip to content

Commit 4573f25

Browse files
Fix: incorrect labelling of branches as protected due to regex matching substrings
1 parent 0c6a1c6 commit 4573f25

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/branch-deletion-pr-creation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
5555
for BRANCH in $ALL_BRANCHES; do
5656
branch_lower=$(echo "$BRANCH" | tr '[:upper:]' '[:lower:]')
57-
if [[ $branch_lower =~ (backup|development|main|master|production) ]]; then
57+
if [[ $branch_lower =~ ^(backup|development|main|master|production)(-[0-9]+)?$ ]]; then
5858
PROTECTED_BRANCHES+=("$BRANCH (protected)")
5959
elif git branch -r --merged origin/development | grep -q "origin/$BRANCH"; then
6060
MERGED_BRANCHES_TO_PROCESS+=("$BRANCH")

0 commit comments

Comments
 (0)