fix(gh-tickets skill): 3 Bugs in next-ticket + create-next-ticket korrigiert
next-ticket.ps1:
- --json-Flag: Leerzeichen nach Kommas entfernt ('number, title, labels'
→ 'number,title,labels'). gh CLI interpretierte die Felder als 3
separate Argumente → Fehler 'accepts 1 arg(s), received 3'.
- gh project item-list ohne --limit ergänzt (--limit 200). Das
Standard-Limit von 20 führt bei >20 Board-Items dazu, dass Tickets
nicht gefunden werden.
create-next-ticket.ps1:
- Type-Label-Validierung war unvollständig: nur migration, tech-decision
und infrastructure wurden akzeptiert. Alle 8 gültigen Typen ergänzt
(block-planning, feature, refactoring, planning, test).
This commit is contained in:
parent
5030ac929a
commit
8a6882cc56
2 changed files with 5 additions and 4 deletions
|
|
@ -25,9 +25,10 @@ $orderFieldId = "PVTF_lAHOCFqiJ84BXk9UzhSw4jo"
|
|||
|
||||
# --- 1. Type-Label validieren ---
|
||||
$labelList = $Labels -split ',' | ForEach-Object { $_.Trim() }
|
||||
$hasType = ($labelList -contains "migration") -or ($labelList -contains "tech-decision") -or ($labelList -contains "infrastructure")
|
||||
$validTypes = @("migration","tech-decision","infrastructure","block-planning","feature","refactoring","planning","test")
|
||||
$hasType = ($labelList | Where-Object { $validTypes -contains $_ }).Count -gt 0
|
||||
if (-not $hasType) {
|
||||
Write-Error "Mindestens ein Type-Label erforderlich: migration, tech-decision, infrastructure"
|
||||
Write-Error "Mindestens ein Type-Label erforderlich: $($validTypes -join ', ')"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
|
|
|||
4
.github/skills/gh-tickets/next-ticket.ps1
vendored
4
.github/skills/gh-tickets/next-ticket.ps1
vendored
|
|
@ -13,7 +13,7 @@ $repo = "jreinemann-euris/krisenvorrat"
|
|||
|
||||
if ($IssueNumber -gt 0) {
|
||||
# Variante A: Explizite Issue-Nummer
|
||||
$json = gh issue view $IssueNumber --repo $repo --json number, title, labels | ConvertFrom-Json
|
||||
$json = gh issue view $IssueNumber --repo $repo --json number,title,labels | ConvertFrom-Json
|
||||
$labels = $json.labels | ForEach-Object { $_.name }
|
||||
$type = if ($labels -contains "block-planning") { "[B]" }
|
||||
elseif ($labels -contains "migration") { "[M]" }
|
||||
|
|
@ -28,7 +28,7 @@ if ($IssueNumber -gt 0) {
|
|||
}
|
||||
else {
|
||||
# Variante B: Nächstes Ticket per Board-Query (client-seitig auf Todo gefiltert)
|
||||
$raw = gh project item-list 2 --owner jreinemann-euris --format json | ConvertFrom-Json
|
||||
$raw = gh project item-list 2 --owner jreinemann-euris --format json --limit 200 | ConvertFrom-Json
|
||||
if ($null -eq $raw -or $null -eq $raw.items) {
|
||||
Write-Host "Keine offenen Tickets gefunden."
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue