Skip to content

Commit be568fc

Browse files
committed
Fix: Handle missing ai-generated label gracefully
- Create PR with enhancement label first - Try to add ai-generated label separately, ignore error if label doesn't exist - Prevents workflow failure when ai-generated label is not configured
1 parent 041d443 commit be568fc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/feature-request-enhance.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,16 @@ jobs:
397397
PR_BODY=$(echo "$PR_BODY" | sed "s/\$ISSUE_NUMBER/$ISSUE_NUMBER/g")
398398
399399
# Create PR
400-
gh pr create \
400+
PR_NUMBER=$(gh pr create \
401401
--title "feat: Implementation plan for issue #$ISSUE_NUMBER" \
402402
--body "$PR_BODY" \
403403
--base develop \
404404
--head "$BRANCH_NAME" \
405-
--label "ai-generated,enhancement"
405+
--label "enhancement" \
406+
--json number --jq '.[0].number')
407+
408+
# Try to add ai-generated label if it exists (ignore error if label doesn't exist)
409+
gh pr edit "$PR_NUMBER" --add-label "ai-generated" 2>/dev/null || echo "⚠️ Label 'ai-generated' not found, skipping"
406410
407411
echo "✅ Created PR for branch $BRANCH_NAME"
408412
else

0 commit comments

Comments
 (0)