Запросил ветку PR по его идентификатору

This commit is contained in:
Антон Чичков 2024-10-24 10:03:12 +10:00
parent 2e7a34759c
commit 0305da0b4b

View File

@ -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)