Created
April 18, 2025 14:15
-
-
Save shashank-shekhar/845ddb4950d64bc867447c415240154c to your computer and use it in GitHub Desktop.
Update version of node package
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
| $SourcesDirectory = "/path/to/packa.json/directory/" | |
| $BuildId = "1234" # This should be set to the actual build ID in your CI/CD pipeline | |
| $packageJsonPath = "$(SourcesDirectory)/package.json" | |
| $package = Get-Content $packageJsonPath | ConvertFrom-Json | |
| $package.version = "0.1.$(BuildId)" | |
| $package | ConvertTo-Json -Depth 100 | Set-Content $packageJsonPath -Encoding UTF8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment