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
This commit is contained in:
+41
-1
@@ -321,7 +321,47 @@ pipelines:
|
|||||||
done
|
done
|
||||||
echo "BLOCKED: target must be one of: ${ALLOWED}"; exit 1
|
echo "BLOCKED: target must be one of: ${ALLOWED}"; exit 1
|
||||||
- step: *ai-code-review
|
- 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
|
# CUSTOM — manually triggered from the Bitbucket UI
|
||||||
|
|||||||
Reference in New Issue
Block a user