Avoid adding and committing every file when releasing#163
Open
abarmat wants to merge 2 commits intovercel:masterfrom
Open
Avoid adding and committing every file when releasing#163abarmat wants to merge 2 commits intovercel:masterfrom
abarmat wants to merge 2 commits intovercel:masterfrom
Conversation
|
cc @leo |
mstruebing
suggested changes
Dec 15, 2019
lib/bump.js
Outdated
| try { | ||
| await runGitCommand(`git add -A && git commit -a -m "${version}"`); | ||
| await runGitCommand( | ||
| `git add package.json package-lock.json && git commit -m "${version}"` |
There was a problem hiding this comment.
This would fail if a package-lock.json is missing, i.e. if the user uses yarn.
You should check before if there is a package-lock.json or yarn.lock present in my opinion.
Author
There was a problem hiding this comment.
Thank you for the feedback. I've added a check to commit package-lock.json only if it is present. I excluded yarn.lock from the commit as I see release is only changing package.json and package-lock.json in the increment() function.
mstruebing
approved these changes
Dec 18, 2019
jackfletch
approved these changes
Dec 25, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a change on the standard behaviour when releasing.
Release by default adds all the files in your local repo and then commit everything, this might cause undesired files to be pushed, a security risk depending on the files exposed.
This change will only commit
package.jsonandpackage-lock.jsonas part of the bump version stage.Closes #162