OCram85/DroneHelper
OCram85
/
DroneHelper
Archived
1
0
Fork 0

add parameter for custom gitea user
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
OCram85 2022-07-13 16:08:38 +02:00
parent 96ae140414
commit 9b21febd7e
Signed by: OCram85
GPG Key ID: 456940F03DE016E1
1 changed files with 7 additions and 2 deletions

View File

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