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 }}