From 31000f7d9bd55c287d55f1c448d6fea56ac2af56 Mon Sep 17 00:00:00 2001 From: achi Date: Fri, 17 Jan 2025 15:39:43 +1000 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D1=80=D1=83=D1=87=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=20=D1=82=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Handle-PullRequestComment.ps1 | 14 +++----------- action.yml | 10 +++++----- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Handle-PullRequestComment.ps1 b/Handle-PullRequestComment.ps1 index 3e5e683..0367dbf 100644 --- a/Handle-PullRequestComment.ps1 +++ b/Handle-PullRequestComment.ps1 @@ -1,25 +1,17 @@ param( [Parameter(Mandatory=$true)] [string] $teamCityToken, - [Parameter(Mandatory=$true)] [string] $giteaToken, - [Parameter(Mandatory=$true)] [string] $pullId + [Parameter(Mandatory=$true)] [string] $branch, + [Parameter] [bool] $web ) $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" -$webLabel = $pull.labels | Where-Object { $_.name -eq "comp/Web" } - -if ($webLabel) +if ($web) { Write-Host "Running web tests" & $scriptDir/Run-TeamCityBuild.ps1 -token $teamCityToken -branch $branch -buildId "LU_Tests_WebTests" diff --git a/action.yml b/action.yml index 02ab157..8c701c2 100644 --- a/action.yml +++ b/action.yml @@ -5,11 +5,11 @@ inputs: teamcity-token: description: 'Teamcity token' required: true - gitea-token: - description: 'Gitea token token' + branch: + description: 'Branch' required: true - pull-id: - description: 'Pull request id' + web: + description: 'Run web' required: true runs: @@ -17,4 +17,4 @@ runs: steps: - name: Start Teamcity tests shell: powershell - run: ${{ gitea.action_path }}/Handle-PullRequestComment.ps1 -teamCityToken ${{ inputs.teamcity-token }} -giteaToken ${{ inputs.gitea-token }} -pullId ${{ inputs.pull-id }} + run: ${{ gitea.action_path }}/Handle-PullRequestComment.ps1 -teamCityToken ${{ inputs.teamcity-token }} -branch ${{ inputs.branch }} -web ${{ inputs.web }}