-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Tools repo Sync to make use of patch files rather than replacing all files in the sync directory * Update location of patch files * Add some changes in eng/common to test things * Update patch application logic * Switch to pushing to upstream * Change workflow to use upstream branches * Add step tp delete braches after merging
- Loading branch information
1 parent
6a2634b
commit 42e0e2b
Showing
8 changed files
with
330 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[CmdletBinding(SupportsShouldProcess = $true)] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$RepoOwner, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$RepoName, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$IssueNumber, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$CommentPrefix, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$Comment, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$CommentPostFix, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$AuthToken | ||
) | ||
|
||
. "${PSScriptRoot}\logging.ps1" | ||
|
||
$headers = @{ | ||
Authorization = "bearer $AuthToken" | ||
} | ||
|
||
$apiUrl = "https://api.github.com/repos/$RepoOwner/$RepoName/issues/$IssueNumber/comments" | ||
|
||
$commentPrefixValue = [System.Environment]::GetEnvironmentVariable($CommentPrefix) | ||
$commentValue = [System.Environment]::GetEnvironmentVariable($Comment) | ||
$commentPostFixValue = [System.Environment]::GetEnvironmentVariable($CommentPostFix) | ||
|
||
if (!$commentPrefixValue) { $commentPrefixValue = $CommentPrefix } | ||
if (!$commentValue) { $commentValue = $Comment } | ||
if (!$commentPostFixValue) { $commentPostFixValue = $CommentPostFix } | ||
|
||
$PRComment = "$commentPrefixValue $commentValue $commentPostFixValue" | ||
|
||
$data = @{ | ||
body = $PRComment | ||
} | ||
|
||
try { | ||
$resp = Invoke-RestMethod -Method POST -Headers $headers -Uri $apiUrl -Body ($data | ConvertTo-Json) | ||
} | ||
catch { | ||
LogError "Invoke-RestMethod [ $apiUrl ] failed with exception:`n$_" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[CmdletBinding(SupportsShouldProcess = $true)] | ||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string]$Organization, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$Project, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$SourceBranch, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[int]$DefinitionId, | ||
|
||
[Parameter(Mandatory = $false)] | ||
[string]$VsoQueuedPipelines, | ||
|
||
[Parameter(Mandatory = $true)] | ||
[string]$AuthToken | ||
) | ||
|
||
. "${PSScriptRoot}\logging.ps1" | ||
|
||
$headers = @{ | ||
Authorization = "Basic $AuthToken" | ||
} | ||
|
||
$apiUrl = "https://dev.azure.com/$Organization/$Project/_apis/build/builds?api-version=6.0" | ||
|
||
$body = @{ | ||
sourceBranch = $SourceBranch | ||
definition = @{ id = $DefinitionId } | ||
} | ||
|
||
Write-Verbose ($body | ConvertTo-Json) | ||
|
||
try { | ||
$resp = Invoke-RestMethod -Method POST -Headers $headers $apiUrl -Body ($body | ConvertTo-Json) -ContentType application/json | ||
} | ||
catch { | ||
LogError "Invoke-RestMethod [ $apiUrl ] failed with exception:`n$_" | ||
exit 1 | ||
} | ||
|
||
LogDebug "Pipeline [ $($resp.definition.name) ] queued at [ $($resp._links.web.href) ]" | ||
|
||
if ($VsoQueuedPipelines) { | ||
$enVarValue = [System.Environment]::GetEnvironmentVariable($VsoQueuedPipelines) | ||
$QueuedPipelineLinks = if ($enVarValue) { | ||
"$enVarValue<br>[$($resp.definition.name)]($($resp._links.web.href))" | ||
}else { | ||
"[$($resp.definition.name)]($($resp._links.web.href))" | ||
} | ||
$QueuedPipelineLinks | ||
Write-Host "##vso[task.setvariable variable=$VsoQueuedPipelines]$QueuedPipelineLinks" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.