actions icon indicating copy to clipboard operation
actions copied to clipboard

Allow regexp for release tags

Open hwoarang opened this issue 4 years ago • 5 comments

Hello,

First let me say that I find this action super useful :) saves me a lot of time writing changelogs myself. Thank you for that

If I understand the action correctly, the generated changelog will always been between the current semver compatible tag and the previous one. So in the following scenario

1.0.0 <-- previous release tag
1.0.1-beta
1.0.1-rc
1.0.1 <-- latest release tag

The changelog for 1.0.1 will only show the commits since 1.0.1-rc. Would it be possible to allow some kind of regexp so I can configure the action to generate changelogs between tags that match, say, [0-9]+.[0-9]+.[0-9]+ for example?

Thank you

hwoarang avatar May 07 '20 06:05 hwoarang

In theory this sounds doable but I am not sure how feasible it is in reality, in terms of how much logic changes + maintainability.

If you want to take a quick (prototype) stab at it I'm game - assuming it's not too much work. If it works for me we can add tests & such to prevent future regressions.

marvinpinto avatar Jun 01 '20 18:06 marvinpinto

@marvinpinto maybe it can be solved in a different way

If the GH action created a release object for 1.0.0 and 1.0.1, the changelog should ideally contain all the entries between the two release objects respectively of whether there are semver-like tags in between them. Say you have a workflow running on this condition:

on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"

This will run for 1.0.0 and 1.0.1 but not for -rc and -beta.

So in the previous example, 1.0.1-beta and 1.0.1-rc which happen to match semver but they do not have a release object attached to them, they should be simply ignored. Would that make more sense? Unfortunately my JS-foo is not so strong right now to get this working asap :(

The way I see it, I think it makes more sense to base the changelog diff based on the github releases rather than the actual git tags :thinking:

hwoarang avatar Jun 01 '20 18:06 hwoarang

Okay then, I'll take a stab at this if I get some time :+1:

(also open to anyone one who's interested)

marvinpinto avatar Jun 01 '20 18:06 marvinpinto

@marvinpinto thank you that would be great!

hwoarang avatar Jun 02 '20 14:06 hwoarang

@marvinpinto I took a shot with https://github.com/marvinpinto/actions/pull/30 let me know what you think

hwoarang avatar Jun 05 '20 08:06 hwoarang