What we're trying to do
We are using Azure Pipelines (azure-pipelines.yml
) to automate ci/cd. Part of our configuration completes the versioning of our project for publishing to Azure Artifacts. We're also trying to configure this to update the existing version number in package.json
without triggering a new pipeline in Azure DevOps.
This is the relevant section for our azure-pipelines.yml
file:
- script: |
git config --global user.email "email@example.com"
git config --global user.name "User name"
npm version patch -m "Bump version to %s [skip ci]" --force
displayName: 'Bump release version'
- script: |
npm pack
displayName: 'Package package'
This works well to publish the package to our Azure Artifacts feed, but does not update the existing version in package.json
Our package.json
contains the following:
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/git",
{
"assets": [
"dist/",
"package.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Question
How would we update the script to ensure the version
value in package.json
is also updated without triggering another pipeline execution (which would result in an endless loop of triggering new pipeline executions)?