Fix drone build pipeline #1

Merged
OCram85 merged 9 commits from DroneTest into master 2022-07-13 16:19:34 +02:00
Showing only changes of commit 9b21febd7e - Show all commits

View File

@ -29,7 +29,12 @@ function Send-PRComment {
param ( param (
[Parameter(Mandatory = $false, HelpMessage = 'HelpMessage')] [Parameter(Mandatory = $false, HelpMessage = 'HelpMessage')]
[ValidateSet('Add', 'Edit', 'Renew')] [ValidateSet('Add', 'Edit', 'Renew')]
[string]$Mode = 'Renew' [string]$Mode = 'Renew',
[Parameter(Mandatory = $false, HelpMessage = 'Gitea user for drone bot')]
[ValidateNotNullOrEmpty()]
[string]$GiteaUser= 'drone-bot'
) )
begin { begin {
@ -89,7 +94,7 @@ function Send-PRComment {
if ($Mode -eq 'Renew') { if ($Mode -eq 'Renew') {
$Comments = Invoke-RestMethod -Method 'Get' -Headers $APIHeaders -Uri $CommentAPICall $Comments = Invoke-RestMethod -Method 'Get' -Headers $APIHeaders -Uri $CommentAPICall
$DroneComments = $Comments | Where-Object { $DroneComments = $Comments | Where-Object {
$_.user.login -eq 'drone' $_.user.login -eq $GiteaUser
} | Select-Object -ExpandProperty 'id' } | Select-Object -ExpandProperty 'id'
Write-Debug -Message ('Found Drone comments: {0}.' -f ($DroneComments -join ', ')) Write-Debug -Message ('Found Drone comments: {0}.' -f ($DroneComments -join ', '))
foreach ($id in $DroneComments) { foreach ($id in $DroneComments) {