Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Validate name Tag bitbucket

João Correia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 16, 2023

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


1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2023

Hello @João Correia and thank you for reaching out to Community!

By the time the pipeline/webhook is triggered, the tag/branch would have been already created, so I'm afraid it's currently not possible to enforce the branch/tag name conventions in Bitbucket Cloud.

We do have an open feature request to implement this functionality, which you can find in the following link: 

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Thank you, @João Correia !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events