Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to reuse values captured from ref to search a tag #338

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mrozanc
Copy link

@mrozanc mrozanc commented Sep 22, 2024

I have this use case where I have branches containing a part of the version, but I need to resolve the rest of the version from the previous tags.

For example, release/2.3 will set the base version to 2.3.0 but on this branch, the release is still in preparation, so I need to check for specific tags that match the version from the branch (2.3.0-rc.1 and other increments starting with 2.3) in order to not mix any other tag versions with the release to go.

I implemented a way to put placeholders in the describeTagPattern to find the right tags, like:

<ref type="branch">
  <pattern><![CDATA[release/(?<major>\d+)\.(?<minor>\d+)(?:\.x)?]]></pattern>
  <describeTagPattern>\Qrelease-marker-{{ref.major}}.{{ref.minor}}\E</describeTagPattern>
  <version>${ref.major}.${ref.minor}.0-rc.${describe.distance}-SNAPSHOT</version>
</ref>

The idea is that {{ is normally not valid for regex if not escaped. If the key found is not part of the map, the placeholder is left untouched.

@qoomon qoomon self-requested a review September 23, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants