Github Workflow: Update update plugin version to also update nested version in package-lock.json #53503
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.json
file. As a result, there is now a.packages[''].version
key that also needs to be bumped when version numbers are bumped.How?
Update the
jq
logic so that it updates the.packages[""].version
attribute in addition to the root.version
attribute.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.
jq
installed locally. On a Mac, you can install it by runningbrew install jq
.VERSION
variable before then running the code change proposed in this PR:In this example we're updating to the string
apples
to 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.version
attribute, and.packages[""].version
have been updated: