List all files changed in a pull request in Git/GitHub

前端 未结 6 1735
执念已碎
执念已碎 2020-12-29 04:58

Is there a way (from the command line) to list the names of all files changed in a PR in Git/GitHub? This would be used to find what tests need to be run in a Travis CI buil

6条回答
  •  无人及你
    2020-12-29 05:30

    Here is the simple method:

    1. Generate below url for POST request https://dev.azure.com/**{OranizationName}**/_apis/Contribution/HierarchyQuery/project/**{ProjectID}**?api-version=5.0-preview.1
    2. Refer this link for any value you need https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1
    3. Use below Json as a request param {"contributionIds":["ms.vss-code-web.pr-detail-data-provider"],"dataProviderContext":{"properties":{"pullRequestId":{PullRequestID},"repositoryId":"{repositoryId}","sourcePage":{"url":"https://dev.azure.com/{OrganizationName}/{ProjectName}/_git/{RepositoryName}/pullrequest/{PullRequestID}?_a=files"}}}}
    4. Send POST request
    5. Get Count from highlighted property to get the file count for each PR

    6. Create access token in Azure DevOps and use it for authentication 7. Provide Code and Token Administration access to token

提交回复
热议问题