Closed jcfr closed 2 years ago
It would be useful to create an appveyor add-on allowing to get the branch associated with a PR number.
Possible filename: appveyor/get_pullrequest_branch.ps1
appveyor/get_pullrequest_branch.ps1
$env:BOOTSRAP_BRANCH = $env:APPVEYOR_REPO_BRANCH if($env:APPVEYOR_PULL_REQUEST_NUMBER -ne $null) { # # Since AppVeyor provides only the PR numbder, retrieve # PR branch name directly from GitHub # # See also https://developer.github.com/v3/pulls/#get-a-single-pull-request # $GitHubUri="https://api.github.com/repos/scikit-build/scikit-ci/pulls/$env:APPVEYOR_PULL_REQUEST_NUMBER" $env:BOOTSRAP_BRANCH=(Invoke-WebRequest ` -Uri $GitHubUri ` -Headers @{ ` "Authorization"="token $env:GH_CMDLINE_TOKEN"; ` "Accept"= "application/vnd.github.v3.raw" ` } | ConvertFrom-Json).head.ref } Write-Host "BOOTSRAP_BRANCH:$env:BOOTSRAP_BRANCH" # Clear GH_CMDLINE_TOKEN variable Remove-Item Env:GH_CMDLINE_TOKEN
It would be useful to create an appveyor add-on allowing to get the branch associated with a PR number.
Possible filename:
appveyor/get_pullrequest_branch.ps1