From 0305da0b4bdc44196ebfb5ecaf0c3e8f24a569bc Mon Sep 17 00:00:00 2001 From: achi Date: Thu, 24 Oct 2024 10:03:12 +1000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B2=D0=B5=D1=82=D0=BA=D1=83=20PR=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=B5=D0=B3=D0=BE=20=D0=B8=D0=B4=D0=B5=D0=BD=D1=82=D0=B8=D1=84?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D1=82=D0=BE=D1=80=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Handle-PullRequestComment.ps1 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Handle-PullRequestComment.ps1 b/Handle-PullRequestComment.ps1 index d06132a..3e5e683 100644 --- a/Handle-PullRequestComment.ps1 +++ b/Handle-PullRequestComment.ps1 @@ -1,25 +1,22 @@ param( [Parameter(Mandatory=$true)] [string] $teamCityToken, [Parameter(Mandatory=$true)] [string] $giteaToken, - [Parameter(Mandatory=$true)] [string] $branch, [Parameter(Mandatory=$true)] [string] $pullId ) -Write-Output "Starting tests in $branch" - $scriptDir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent +# Получим инфо о пулл-реквесте + +$pull = Invoke-RestMethod -Uri https://sc.lers.ru/api/v1/repos/lers/LersUchet/pulls/$pullId -Headers @{Authorization = "token $giteaToken"} + +$branch = $pull.head.ref +Write-Output "Starting tests in $branch" + & $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_FullTests" & $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_ReleaseBuild" -# Получим теги пулл-реквеста - -Invoke-RestMethod -Uri https://sc.lers.ru/api/v1/repos/lers/LersUchet/pulls/$pullId -Headers @{Authorization = "token $giteaToken"} - -Write-Output $pull.labels -Write-Output "checking wb" - $webLabel = $pull.labels | Where-Object { $_.name -eq "comp/Web" } if ($webLabel)