I'm setting up a pipeline in bitbucket and I was wondering if anyone could tell me if with a pipeline I can prevent a branch from being created or a tag from being created if it's outside a naming standard.
would it be possible to do this using a pipeline, webhooks or some other way?
image: atlassian/default-image:3
pipelines:
tags:
'*':
- step:
name: Check SemVer Tag
script:
- SEMVER_REGEX="^[0-9]{2}\.[0-9]{2}\.[0-9]{2}$"
- if [[ "$BITBUCKET_TAG" =~ $SEMVER_REGEX ]]; then
echo "Valid SemVer tag.";
else
echo "Invalid SemVer tag. Tags should follow Semantic Versioning.";
exit 1;
fi