From 1527fbc74011ec3fe621e95cbae9fb26be43f18c Mon Sep 17 00:00:00 2001 From: Sujit Deokar Date: Fri, 17 Apr 2026 12:15:30 +0000 Subject: [PATCH] Merged in feature/upDatepipelinesFile (pull request #963) Added logic to capture failure status for invalid branch names * Added logic to capture failure status for invalid branch names * Merged dev into feature/upDatepipelinesFile --- bitbucket-pipelines.yml | 42 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index ec7ec94..0b5c7a7 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -321,7 +321,47 @@ pipelines: done echo "BLOCKED: target must be one of: ${ALLOWED}"; exit 1 - step: *ai-code-review - + + # ------------------------------------------------------------------------- + # Catch-all: Enforce branch naming standards + # ------------------------------------------------------------------------- + # Any branch that doesn't match the patterns above (feature/*, bugfix/*, + # hotfix/*, dev, stg) will match this catch-all. It fails immediately + # to enforce branch naming conventions. + # + # Allowed branch prefixes: + # • feature/* (new features) + # • bugfix/* (bug fixes) + # • hotfix/* (urgent production fixes) + # • dev (development integration) + # • stg (staging promotion) + # ------------------------------------------------------------------------- + "**": + - step: + name: "Validate branch naming" + image: atlassian/default-image:4 + script: + - | + echo "============================================================" + echo "BRANCH NAMING STANDARD VIOLATION" + echo "============================================================" + echo "Branch: ${BITBUCKET_PR_SOURCE_BRANCH}" + echo "" + echo "This branch does not match allowed naming conventions." + echo "" + echo "Allowed prefixes:" + echo " • feature/* — for new features" + echo " • bugfix/* — for bug fixes" + echo " • hotfix/* — for urgent production fixes" + echo "" + echo "Examples of valid branch names:" + echo " • feature/user-authentication" + echo " • bugfix/login-page-crash" + echo " • hotfix/security-patch" + echo "" + echo "Please rename your branch to match the standard and try again." + echo "============================================================" + exit 1 # =========================================================================== # CUSTOM — manually triggered from the Bitbucket UI