-
Notifications
You must be signed in to change notification settings - Fork 66
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
Conversation
There was a problem hiding this 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') |
There was a problem hiding this comment.
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"
...
src/dependabot/update_metadata.ts
Outdated
const prev = bumpFragment?.groups?.from ?? '' | ||
const next = bumpFragment?.groups?.to ?? '' | ||
const prev = bumpFragment?.groups?.from.replace('v', '') ?? '' | ||
const next = bumpFragment?.groups?.to.replace('v', '') ?? '' |
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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...
Fix #244