Я пытаюсь изменить источник с репозитория azure git на GitHub в сборке Azure DevOps с помощью rest api.
Это ответ, который я получаю для репозиториев azure с использованием определений сборки azure Devops rest api - GET https://dev.azure.com/%7Borg_name%7D/%7Bproject_name%7D/_apis/build/definitions/%7BBuild_Id%7D?Api-version=6.0?
"repository": {
"properties": {
"cleanOptions": "0",
"labelSources": "0",
"labelSourcesFormat": "$(build.buildNumber)",
"reportBuildStatus": "true",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"checkoutNestedSubmodules": "false",
"fetchDepth": "0"
},
"id": "xxxx",
"type": "TfsGit",
"name": "{repo_name}",
"url": "https://dev.azure.com/{org_name}/{project_name}/_git/{repo_name}",
"defaultBranch": "refs/heads/master",
"clean": "false",
"checkoutSubmodules": false
},
Если вручную я меняю источник с репозиториев Azure на GitHub, это будет ответ json, который я получаю для репозитория GitHub -
"repository": {
"properties": {
"apiUrl": "https://api.github.com/repos/{github_id}/{repo_name}",
"branchesUrl": "https://api.github.com/repos/{github_id}/{repo_name}/branches",
"cloneUrl": "https://github.com/{github_id}/{repo_name}.git",
"connectedServiceId": "xxxxxxx",
"defaultBranch": "master",
"fullName": "{github_id}/{repo_name}",
"hasAdminPermissions": "True",
"isFork": "False",
"isPrivate": "False",
"lastUpdated": "10/16/2019 17:28:29",
"manageUrl": "https://github.com/{github_id}/{repo_name}",
"nodeId": "xxxxxx",
"ownerId": "xxxxx",
"orgName": "{github_id}",
"refsUrl": "https://api.github.com/repos/{github_id}/pyapp/git/refs",
"safeRepository": "{github_id}/pyapp",
"shortName": "{repo_name}",
"ownerAvatarUrl": "https://avatars2.githubusercontent.com/u/xxxxx?v=4",
"archived": "False",
"externalId": "xxxxxx",
"ownerIsAUser": "True",
"checkoutNestedSubmodules": "false",
"cleanOptions": "0",
"fetchDepth": "0",
"gitLfsSupport": "false",
"reportBuildStatus": "true",
"skipSyncSource": "false",
"labelSourcesFormat": "$(build.buildNumber)",
"labelSources": "0"
},
"id": "{github_id}/{repo_name}",
"type": "GitHub",
"name": "{github_id}/{repo_name}",
"url": "https://github.com/{github_id}/{repo_name}.git",
"defaultBranch": "master",
"clean": "false",
"checkoutSubmodules": false
Я попытался изменить репозиторий azure на github с помощью почтальона, скопировав тело ответа GitHub json и добавив почтальона, и попытался вызвать put -https: //dev.azure.com/ {org_name} / {project_name} / _apis / build / definitions / {Build_Id}? Api-version = 6.0?
Но это не работает
Как я могу добиться этого с помощью скрипта или почтальона? что мне здесь не хватает?