-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] Use pipeline to update gather-docs.yaml during releases #7546
base: master
Are you sure you want to change the base?
Conversation
Maybe calling this script in core-build.yaml instead could be better? Then the condition would just be to run this script as long as the package publish step runs? I think I like that idea better than running the script in the release pipeline, but not entirely sold on either. |
import path from "path"; | ||
|
||
function checkFile(filePath, currentBranch) { | ||
// const filePath = path.normalize("./common/config/azure-pipelines/templates/gather-docs.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this comment since this is called in main()? Maybe add a comment to the function explaining that the filePath Param is expected to be normalized
|
||
const textToFind = /refs\/heads\/release\/\d+\.\d+\.x/gi; | ||
if (!currentBranch.match(textToFind)) { | ||
console.error("Invalid branch name."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this message should be more specific: "current branch name does not match the expected format"
Use a script to find and replace the branchName in gather-docs.ymal file.
We would want to run this script whenever we publish build artifacts on a release branch, this is because the first time we build on a new release branch we target the previous release branch. Once that build publishes artifacts we want to update the yml file to the current release branch.
I created a new yaml file to trigger this, which runs every time we publish an artifact during the itwin.js builds. Don't know if this is the best way to call the script. Maybe just putting it at the end of the release pipeline which has a similar trigger, however that lives in the imodeljs-build-pipeline-scripts repo.