Fix Gitea wrapper login resolution (#538)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

This commit was merged in pull request #538.
This commit is contained in:
2026-06-12 02:34:18 +00:00
parent bd9527c033
commit 98a771c8f8
34 changed files with 937 additions and 84 deletions

View File

@@ -9,7 +9,6 @@ param(
[Alias("b")]
[string]$Body,
[Alias("B")]
[string]$Base,
[Alias("H")]
@@ -101,6 +100,11 @@ switch ($platform) {
& $cmd[0] $cmd[1..($cmd.Length-1)]
}
"gitea" {
$repoArgs = @(Get-GiteaRepoArgs)
if ($repoArgs.Length -eq 0) {
Write-Error "Could not resolve Gitea repo/login for remote host"
exit 1
}
$cmd = @("tea", "pr", "create", "--title", $Title)
if ($Body) { $cmd += @("--description", $Body) }
if ($Base) { $cmd += @("--base", $Base) }
@@ -108,7 +112,7 @@ switch ($platform) {
if ($Labels) { $cmd += @("--labels", $Labels) }
if ($Milestone) {
$milestoneList = tea milestones list 2>$null
$milestoneList = tea milestones list @repoArgs 2>$null
$milestoneId = ($milestoneList | Select-String "^\s*(\d+).*$Milestone" | ForEach-Object { $_.Matches.Groups[1].Value } | Select-Object -First 1)
if ($milestoneId) {
$cmd += @("--milestone", $milestoneId)
@@ -121,6 +125,7 @@ switch ($platform) {
Write-Warning "Draft PR may not be supported by your tea version"
}
$cmd += $repoArgs
& $cmd[0] $cmd[1..($cmd.Length-1)]
}
default {