我知道我可以将特定步骤限制为“条件:变更集:includePaths:”这不是我想要做的。
我知道我可以使用 git diff
获得修改文件的列表
在最后一次提交中。不幸的是,这还不够。
我想做的是获取自上次推送以来在此分支中已修改的所有文件的列表。例如,假设您执行以下操作:
使用
pull-requests,我想我可以通过比较 BITBUCKET_COMMIT
和
BITBUCKET_PR_DESTINATION_BRANCH
来做到这一点。但是对于我想在每次推送提交时运行的管道步骤,我不知道如何获取我想要的变更集。
# Get the PR diffstat URL
curl --request GET --url "https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}" --header "Authorization: Bearer <access_token>" --header "Accept: application/json" -o response.json
DIFFSTAT_URL=$(jq -r .links.diffstat.href response.json)
curl --request GET --url "${DIFFSTAT_URL}" --header "Authorization:Bearer <access_token>" --header "Accept: application/json" -o diffstat.json
jq -r .values[].new.path diffstat.json > changelog.txt
来源:https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests