I have a branch name, for example, release-1.1.3, how I can split and extract the version by writing some logic in gitlab-ci file. Is there some method available for it?
before_script
export BRANCH_NAME=$CI_COMMIT_REF_NAME
// here I want to do something to extract the version
export Major=BRANCH_NAME.someoperation
any other approaches are also welcome but I required the value in a separate variable which I can pass it to other operations.
I am new to gitlab-ci and working on it, thanks in advance.
Just split your string
You will find some examples here.