Github Workflow: Update update plugin version to also update nested version in package-lock.json#53503
Merged
andrewserong merged 1 commit intotrunkfrom Aug 10, 2023
Conversation
…ersion in package-lock.json
ramonjd
approved these changes
Aug 10, 2023
Member
ramonjd
left a comment
There was a problem hiding this comment.
Looks legit to me
Looks legit to me
diff --git a/package-lock.json b/package-lock.json
index 7fc6c3c6dc..93fb5e2cdc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "gutenberg",
- "version": "16.4.0",
+ "version": "apples",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "gutenberg",
- "version": "16.4.0",
+ "version": "apples",
"hasInstallScript": true,
"license": "GPL-2.0-or-later",
I guess we'll know pretty soon if it breaks, so it should be okay 🤷🏻
Contributor
Author
Thanks for reviewing @ramonjd! This one isn't super urgent to get in since a release was just pushed. I'll leave this PR open overnight and if there's no objections, will merge it in tomorrow morning 🙂 |
Contributor
|
Makes sense. Thanks for the fix. |
Contributor
Author
|
Thanks for the reviews, everyone! 🙇 |
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.
What?
Follow-up to #53499
Update the "update plugin version" workflow step so that it also updates the nested package version for Gutenberg.
Why?
In #53426, the Node and NPM versions were updated, which affects the structure of the
package-lock.jsonfile. As a result, there is now a.packages[''].versionkey that also needs to be bumped when version numbers are bumped.How?
Update the
jqlogic so that it updates the.packages[""].versionattribute in addition to the root.versionattribute.Testing Instructions
I'm not sure how to test this in an automatic way by running the step, however we can manually test the updated line by running it in a local environment.
jqinstalled locally. On a Mac, you can install it by runningbrew install jq.VERSIONvariable before then running the code change proposed in this PR:In this example we're updating to the string
applesto make it clear, but in real world usage, the variable would be set to a real version number.If you then run
git diff, you should see that both the root.versionattribute, and.packages[""].versionhave been updated: