File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
eng/templates/official/jobs Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change 8
8
os : linux
9
9
steps :
10
10
- powershell : |
11
- $githubUser = "$(GithubUser)"
12
11
$githubToken = "$(GithubPat)"
13
12
$newLibraryVersion = "$(NewLibraryVersion)"
14
13
15
14
if($newLibraryVersion -match '(\d)+.(\d)+.(\d)+') {
16
15
# Create GitHub credential
17
16
git config --global user.name "AzureFunctionsPython"
18
17
git config --global user.email "[email protected] "
19
-
20
- # Create GitHub credential
21
- $credential = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${githubUser}:${githubToken}"))
22
18
23
19
# Heading to Artifact Repository
24
20
Write-Host "Operating based on $stagingDirectory/azure-functions-python-library"
34
30
Write-Host "Creating release branch release/$newLibraryVersion"
35
31
git push --repo="https://[email protected] /Azure/azure-functions-python-library.git"
36
32
37
- # Create PR
38
- Write-Host "Creating PR draft in GitHub"
39
- $body = (@{head="$newBranch";base="dev";body="Python SDK Version [$newLibraryVersion]";draft=$true;maintainer_can_modify=$true;title="build: update Python SDK Version to $newLibraryVersion"} | ConvertTo-Json -Compress)
40
- $response = Invoke-WebRequest -Headers @{"Cache-Control"="no-cache";"Content-Type"="application/json";"Authorization"="Basic $credential";"Accept"="application/vnd.github.v3+json"} -Method Post -Body "$body" -Uri "https://api.github.com/repos/Azure/azure-functions-python-library/pulls"
41
-
42
- # Return Value
43
- if ($response.StatusCode -ne 201) {
44
- Write-Host "Failed to create PR in Azure Functions Python Library"
45
- exit -1
46
- }
47
-
48
- $draftUrl = $response | ConvertFrom-Json | Select -expand url
49
- Write-Host "PR draft created in $draftUrl"
50
-
51
33
} else {
52
34
Write-Host "NewLibraryVersion $newLibraryVersion is malformed (example: 1.5.0)"
53
35
exit -1
You can’t perform that action at this time.
0 commit comments