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

Auto version bump #202

Merged
merged 40 commits into from
Jan 13, 2023
Merged

Auto version bump #202

merged 40 commits into from
Jan 13, 2023

Conversation

sameer-coder
Copy link
Contributor

@sameer-coder sameer-coder commented Dec 12, 2022

This PR introduces the auto version bump feature.

The user can now choose the "auto" option for semver version updates. The action will attempt to determine the new version number based on the commit messages. For this option to work, the repository must use the conventional commits standard.

Closes #193

@sameer-coder sameer-coder marked this pull request as ready for review December 12, 2022 11:58
@simoneb
Copy link
Contributor

simoneb commented Dec 12, 2022

Even if this receives reviews, please wait for my review before merging due to the potentially disruptive impact of this change

Copy link
Contributor

@maksimovicdanijel maksimovicdanijel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the function name, otherwise looks good.

src/utils/bump.js Outdated Show resolved Hide resolved
src/utils/bump.js Outdated Show resolved Hide resolved
test/auto-bump.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@simoneb simoneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the main inline comment for the reason why I'm requesting changes

README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@simoneb simoneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more changes then I'll review the actual files containing the new logic

action.yml Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/utils/bump.js Outdated Show resolved Hide resolved
src/utils/bump.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/utils/bump.js Outdated Show resolved Hide resolved
@sameer-coder sameer-coder requested review from simoneb and removed request for simoneb January 9, 2023 09:18
@simoneb
Copy link
Contributor

simoneb commented Jan 9, 2023

@davideroffo can you please review this?

Copy link
Contributor

@davideroffo davideroffo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I left a few minor comments.

README.md Outdated Show resolved Hide resolved
action.yml Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@davideroffo
Copy link
Contributor

@sameer-coder I noticed that the base-tag parameter has not been included in the Inputs section of README.md.

@sameer-coder sameer-coder requested review from simoneb and removed request for simoneb January 12, 2023 06:22
Copy link
Contributor

@simoneb simoneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments

README.md Outdated
@@ -195,7 +200,7 @@ Please note that in case of a prerelease the `sync-semver-tags` input will be tr
| Input | Required | Description |
| --- | --- | --- |
| `github-token` | No | This is your GitHub token, it's [already available](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) to your GitHub action |
| `semver` | Yes | The version you want to bump (`patch|minor|major`). |
| `semver` | Yes | The version you want to bump (`auto|patch|minor|major`). |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't actually up to date. when we introduced support for prereleases we included more options. maybe, instead of listing them, we should just link the npm docs page

src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated
Comment on lines 53 to 58
let latestTag = null
if (!baseTag) {
const allTags = await run('git', ['tag', '--sort=-creatordate'])
const tags = allTags.split('\n')
latestTag = tags[0] || null
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this explicit null handling isn't very intuitive, and probably unnecessary (including the default value of this function's arg)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also prefer avoiding mutable state please, there's most certainly a more elegant way to write this that doesn't require let variables

src/index.js Outdated Show resolved Hide resolved
Copy link
Contributor

@simoneb simoneb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

Support "auto" semver bump
4 participants