mathieudutour / mathieudutour/github-tag-action

Prerelease does not Respect Default_Bump

Open
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
733
Forks
227
PR merge metrics
No merged PRs in 30d

Description

When having `default_bump=minor` I would expect a prerelease to do a minor update when creating the prerelease version. Currently it always does a patch update.

E.g.
latest release is `1.2.3`, I would expect an execution of the action on a branch basing from that version, with parameters `default_bump=minor` and `default_prerelease_bump=prerelease` to generate the version `1.3.0-beta.0`, since 1.3.0 is the version the final release will (most likely) be.
Instead, it currently generates the version `1.2.4-beta.0`, which is a patch increase.

Another run on top should then do the correct prerelease update to create version `1.3.0-beta.1`

I think adjustments need to address the code starting at
https://github.com/mathieudutour/github-tag-action/blob/e923a6115f1a2ccc3404e26ec2535092a9fd5536/src/action.ts#L155

You could argue that this is a bug/feature of semver itself, but it really is relating to correctly interpreting default actions which is responsibility of this module, not semver.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/action.ts around line 155 and reproduce the action with default_bump=minor and default_prerelease_bump=prerelease from version 1.2.3. The fix is done when the first prerelease is 1.3.0-beta.0 and a subsequent run produces 1.3.0-beta.1 rather than patch-based versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, release
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.