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

Allow leading v on commit message versions #245

Closed
wants to merge 0 commits into from
Closed

Allow leading v on commit message versions #245

wants to merge 0 commits into from

Conversation

jonmcquillan
Copy link
Contributor

@jonmcquillan jonmcquillan commented Aug 19, 2022

Fix #244

@jonmcquillan jonmcquillan requested a review from a team as a code owner August 19, 2022 03:40
@jonmcquillan jonmcquillan changed the title Allow leading v on commit message versions (#1) Allow leading v on commit message versions Sep 17, 2022
Copy link
Member

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

This looks great, nice job with the tests.

Just need the one behavior change and then happy to merge... looks pretty straightforward.

Sorry took so long to get this reviewed, but now that I'm familiar with what you're trying to do I can review any updates quickly.

expect(updatedDependencies[0].packageEcosystem).toEqual('nuget')
expect(updatedDependencies[0].targetBranch).toEqual('main')
expect(updatedDependencies[0].prevVersion).toEqual('4.0.1')
expect(updatedDependencies[0].newVersion).toEqual('4.2.2')
Copy link
Member

Choose a reason for hiding this comment

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

As I explained in #244 (comment), I think it'd be more consistent if this was v4.2.2 preserving the "v"...

const prev = bumpFragment?.groups?.from ?? ''
const next = bumpFragment?.groups?.to ?? ''
const prev = bumpFragment?.groups?.from.replace('v', '') ?? ''
const next = bumpFragment?.groups?.to.replace('v', '') ?? ''
Copy link
Member

Choose a reason for hiding this comment

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

I think if you move this replace() from here to where the update is actually calculated then it'll preserve the "v"

src/main.test.ts Outdated
@@ -132,6 +132,75 @@ test('it sets the updated dependency as an output for subsequent actions', async
expect(core.setOutput).toBeCalledWith('cvss', 0)
})

test('it sets the updated dependency as an output for subsequent actions when there is a leading v in the commit message version', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

This is exactly why we should preserve the leading "v"... the user may do post-processing and I'd rather leave the decision to "strip" any prefix up to them...

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.

Handle leading "v" in versions in a commit message
2 participants