ewjoachim / sphinx-github-changelog

Build a sphinx changelog from GitHub Releases
https://sphinx-github-changelog.readthedocs.io
MIT License
27 stars 4 forks source link

Suppress 'v' prefix in tag #140

Open lordmauve opened 1 day ago

lordmauve commented 1 day ago

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 commented 1 day ago

This is the lines that control this behaviour: https://github.com/ewjoachim/sphinx-github-changelog/blob/58db35946c692956934d8a58d5d8c952a7cd8982/sphinx_github_changelog/changelog.py#L116-L119

Do you want to make a PR ?

lordmauve commented 1 day ago

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 commented 22 hours ago

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 )