I wonder if it is possible to echo what were the modified paths between two pull requests using the new feature "changesets"
I have something like that in mind:
- step:
name: step1
condition:
changesets:
- echo changesets
Yes, the information is available by the version control system which is accessible by the git utility. As long as you have it in your build container.
The includePaths directive checks for modified paths.
You can obtain the information by listing modified files between HEAD and the appropriate ancestor which is different depending on the type of the pipeline:
In a pull-request pipeline, all commits are taken into account, and if you provide an
includePath
list of patterns, a step will be executed when at least one commit change matches one of the conditions.
and:
For other types of pipelines, only the last commit is considered.
To show all changed files for the last commit:
git diff --name-only
For the pull request pipeline I don't have one at hand to verify it, the "Build setup" in such a Pipeline should show whether or not the merge is already committed, if so it could be the same or you can diff to the merge base:
git diff --name-only $(git merge-base "${BITBUCKET_PR_DESTINATION_BRANCH}" HEAD)
Use the `--diff-filter` switch to fine-tune which paths are displayed, `--name-status` to show the status of each path and mind path quoting (use `-z` for null-byte separated paths).
Reference:
Awesome, thank you for the explanation!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.