-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat: Add option to skip version bumping. #251
Conversation
Hey @TriPSs, do you think we could add this option? :) |
How different would this be than setting version file to an empty string? |
Well, with an empty string we would cause the following error: throw new Error(`File extension "${ext}" from file "${file}" is not supported`) And even if we use if (skipVersionFile || skipCommit) {
core.info('Using GIT to determine the new version')
const versioning = await handleVersioningByExtension( // this function bumps the version currently
'git',
versionFile,
versionPath,
recommendation.releaseType,
) |
I just added another conditional to set the |
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.
Although I find it a bit weird I do not see any harm in support things, could you do the following:
- Commit to this repo following conventional commits
- Process comments
- Add tests
Thanks for the review, it wasn't entirely clear to me how all the testing in this repo behaves, but I believe my implementation should test it properly according to the existing standards. Regarding your first point:
I did create the PR with a conventional commit message and would usually squash merge & remove all commit messages while squashing, would that work for you, or how exactly should I proceed? |
Also please approve the workflow run again :) |
We could do that, regarding the test: should the tag it creates not be the same as the version in the file? |
The test is also failing, it's creating a tag with |
Indeed, both the test and the implementation need some changes, currently the old version is only loaded after using the bump function, I'll make some more changes. |
Alright, I've adjusted the test as per your suggestion and also changed the classes to use a proper constructor instead of the |
@tomfrenken you can also run the actions locally, see the README. My preference would be to only implement your feature here and leave existing code more as is (So keep the init, as I prefer to only pass args once and not for each class separate). |
@TriPSs thanks for the abstract method suggestion, great idea. |
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.
Thanks already for your work!
Awesome, moving the logic to the version function also removed the code duplication, and the improved conditional logic is also way cleaner. |
Thanks for the PR 🎉 |
Thanks for the quick reviews! |
Hey all,
in our pipeline we already bumped the version of our package.json in a previous step, therefore we would like to skip bumping the version in this action.
This PR should introduce a simple option to do so.