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

Suppress 'v' prefix in tag #140

Open
lordmauve opened this issue Oct 7, 2024 · 4 comments
Open

Suppress 'v' prefix in tag #140

lordmauve opened this issue Oct 7, 2024 · 4 comments

Comments

@lordmauve
Copy link

It is a common practice to tag releases as v1.2.3 for version 1.2.3.

From semver.org:

However, prefixing a semantic version with a “v” is a common way (in English) to indicate it is a version number. Abbreviating “version” as “v” is often seen with version control. Example: git tag v1.2.3 -m "Release version 1.2.3", in which case “v1.2.3” is a tag name and the semantic version is “1.2.3”.

I'm relying on this convention for a few reasons, like GitHub Actions automation with

on:
  push:
    tags:
      - 'v*'

and sometimes

    if: startsWith(github.ref, 'refs/tags/v')

When using this practice, the generated changelog contains headings like

v0.1.2: 0.1.2

If the tags omit the v prefix then the tag name is omitted from the heading but it is more challenging to write GitHub Action automations that match release tags.

I would like the v to be disregarded when comparing the tags and release versions, so that the heading comes out as

0.1.2

@ewjoachim
Copy link
Owner

This is the lines that control this behaviour:

def get_release_title(title: Optional[str], tag: str):
if not title:
return tag
return title if tag in title else f"{tag}: {title}"

Do you want to make a PR ?

@lordmauve
Copy link
Author

Do you want to make a PR ?

Due to corporate policy I need to file paperwork for each open source project I wish to contribute code to. I've requested approval for sphinx-github-changelog but it will take some time.

@ewjoachim
Copy link
Owner

ewjoachim commented Oct 8, 2024

Wow, good luck with that :)
If it's a subtle way of requesting that I do it, no issue I can :) If you're interested in waiting for your request approval, I'll be delighted to wait ;) .

If there's anything I can do to help, let me know :)

(also, I really hope this only applies to contribution on your work time and not on your free time, otherwise that must feel invasive as hell :o )

@lordmauve
Copy link
Author

I really hope this only applies to contribution on your work time and not on your free time, otherwise that must feel invasive as hell

I have a very similar approval needed for contributions on my own time, but there is less scrutiny and it gets approved a lot faster. But yes.

If it's a subtle way of requesting that I do it

No, not at all. You requested that I do it, so I was just answering that question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants