Issue Management Workflow

L3
ModelContextProtocolGithubMCPMark CI/CD

Build intelligent issue management automation with auto-triage, task breakdown for epics, and first-time contributor handling.

Created by Zijian Wu
2025-08-15
Issue ManagementWorkflow Automation

Model Ranking

Click on the dots to view the trajectory of each task run
Model
Run Results
Pass@4
Pass^4
Avg Time
Avg Turns
Input Tokens
Output Tokens
Total Tokens
Claude
claude-opus-4-1
0
/1
--
531.1s
16.0
551,218
8,782
560,000
Claude
claude-opus-4-5-high
0
/4
1596.9s
44.5
1,116,420
118,490
1,234,910
Claude
claude-sonnet-4
0
/4
433.4s
21.8
1,229,808
11,862
1,241,670
Claude
claude-sonnet-4-5
0
/4
495.6s
24.0
976,215
26,760
1,002,974
Claude
claude-sonnet-4-high
0
/4
285.1s
21.0
939,012
11,194
950,206
Claude
claude-sonnet-4-low
0
/4
292.3s
24.0
850,576
10,518
861,094
DeepSeek
deepseek-chat
0
/4
382.4s
11.8
285,917
6,322
292,239
DeepSeek
deepseek-v3-1-terminus
0
/4
327.2s
12.8
565,398
5,218
570,616
DeepSeek
deepseek-v3-1-terminus-thinking
0
/4
1036.0s
12.8
424,378
18,808
443,186
DeepSeek
deepseek-v3-2-chat
0
/4
583.3s
33.3
838,830
12,798
851,627
DeepSeek
deepseek-v3-2-thinking
0
/4
1021.6s
49.5
1,613,051
25,602
1,638,653
Gemini
gemini-2-5-flash
0
/4
214.6s
18.8
753,416
14,807
768,223
Gemini
gemini-2-5-pro
0
/4
126.9s
8.3
137,288
11,368
148,655
Gemini
gemini-3-pro-high
0
/4
229.2s
18.3
438,888
10,732
449,620
Gemini
gemini-3-pro-low
0
/4
231.6s
17.8
422,023
12,565
434,588
Z.ai
glm-4-5
0
/4
465.2s
28.3
1,232,935
15,095
1,248,030
OpenAI
gpt-4-1
0
/4
73.5s
6.5
95,250
3,633
98,883
OpenAI
gpt-4-1-mini
0
/4
111.5s
9.3
141,452
3,503
144,954
OpenAI
gpt-4-1-nano
0
/4
213.9s
17.0
566,939
21,969
588,909
OpenAI
gpt-5-high
0
/4
1868.1s
25.3
1,143,949
68,769
1,212,717
OpenAI
gpt-5-low
0
/4
706.0s
15.5
426,461
40,184
466,645
OpenAI
gpt-5-medium
0
/4
914.1s
27.8
1,021,830
48,568
1,070,398
OpenAI
gpt-5-mini-high
0
/4
569.8s
35.8
1,353,984
46,582
1,400,566
OpenAI
gpt-5-mini-low
0
/4
84.9s
10.3
193,786
6,024
199,810
OpenAI
gpt-5-mini-medium
0
/4
146.0s
19.8
448,471
11,053
459,524
OpenAI
gpt-5-nano-high
0
/4
443.8s
12.5
217,665
90,106
307,771
OpenAI
gpt-5-nano-low
0
/4
50.9s
8.0
106,488
4,065
110,553
OpenAI
gpt-5-nano-medium
0
/4
344.6s
10.5
157,404
69,249
226,653
OpenAI
gpt-oss-120b
0
/4
76.7s
9.5
139,602
5,213
144,815
Grok
grok-4
0
/4
202.6s
6.5
157,371
3,142
165,863
Grok
grok-4-fast
0
/4
86.2s
10.0
228,800
10,159
238,959
Grok
grok-code-fast-1
0
/4
72.3s
11.5
260,578
9,487
270,065
MoonshotAI
kimi-k2-0711
0
/4
232.5s
11.3
281,427
6,617
288,044
MoonshotAI
kimi-k2-0905
0
/4
3600.6s
52.3
2,160,099
45,168
2,205,267
OpenAI
o3
0
/4
105.8s
6.5
95,612
6,374
101,986
OpenAI
o4-mini
0
/4
207.6s
12.5
231,338
13,108
244,446
Qwen
qwen-3-coder-plus
0
/4
490.9s
60.0
4,886,135
17,060
4,903,195
Qwen
qwen-3-max
0
/4
107.5s
11.0
241,455
3,600
245,055

Task State


Instruction

I need you to create an intelligent Issue Management automation workflow for this Node.js project. The project currently has no GitHub Actions workflows, so you'll be building an issue-focused automation system from scratch that responds to issue events. Here's what needs to be implemented:

Issue Management Workflow

Create .github/workflows/issue-automation.yml that triggers on issues events (opened, labeled) with these jobs:

1. issue-triage job:

  • Auto-assigns category labels based on keywords in issue title (case-insensitive):
    • Title contains "bug" → adds bug label
    • Title contains "epic" → adds epic label
    • Title contains "maintenance" → adds maintenance label
  • Auto-assigns priority labels based on keywords in issue title OR body (case-insensitive, highest priority wins if multiple keywords found):
    • "critical", "urgent", "production", "outage" → priority-critical
    • "important", "high", "blocking" → priority-high
    • "medium", "normal" → priority-medium (default if no priority keywords found)
    • "low", "nice-to-have", "minor" → priority-low
  • All issues get needs-triage label initially

2. task-breakdown job:

  • For issues with a title containing "Epic", create exactly 4 sub-issues with the pattern: "[SUBTASK] [Original Title] - Task N: [Task Name]"
  • Task names: 1. Requirements Analysis, 2. Design and Architecture, 3. Implementation, 4. Testing and Documentation
  • Links sub-issues to parent using "Related to #[parent-number]" in sub-issue body
  • Updates parent issue body with "## Epic Tasks" checklist linking to sub-issue numbers
  • All sub-issues get enhancement and needs-review labels

3. auto-response job:

  • Checks if the issue author is creating their first issue in this repository (not first on GitHub globally, but first in this specific repo)
  • If first issue in repo: adds first-time-contributor label and posts welcome message
  • Posts different responses based on issue type:
    • bug issues: comment must contain "Bug Report Guidelines"
    • epic issues: comment must contain "Feature Request Process"
    • maintenance issues: comment must contain "Maintenance Guidelines"
  • Sets milestone "v1.0.0" for priority-high and priority-critical issues
  • Changes status from needs-triage to needs-review after response

Label Management Requirements

The system must create and manage these specific labels:

Category Labels:

  • bug - Something isn't working
  • enhancement - New feature or request
  • epic - Large feature requiring multiple sub-tasks
  • maintenance - Maintenance and housekeeping tasks

Priority Labels:

  • priority-critical - Critical priority issue
  • priority-high - High priority issue
  • priority-medium - Medium priority issue
  • priority-low - Low priority issue

Status Labels:

  • needs-triage - Needs to be reviewed by maintainers
  • needs-review - Awaiting review from maintainers
  • first-time-contributor - Issue created by first-time contributor

Implementation Requirements:

Step 1: Create Feature Branch Create a new branch called issue-management-workflow from main.

Step 2: Create Supporting Files Create these additional files on the new branch:

  • .github/ISSUE_TEMPLATE/bug_report.md - Bug report template
  • .github/ISSUE_TEMPLATE/feature_request.md - Feature request template
  • .github/ISSUE_TEMPLATE/maintenance_report.md - Maintenance report template

Step 3: Implement the Workflow
Create .github/workflows/issue-automation.yml with proper YAML syntax.
Include:

  • Appropriate triggers for issues events
  • Job dependencies where needed
  • Error handling and graceful fallbacks
  • Avoid identifier conflicts in github-script actions (don't redeclare 'github')

Step 4: Create and Merge Pull Request Create a comprehensive pull request and merge it to main:

  • Title: "Implement Issue Management Automation Workflow"
  • Detailed description of the workflow and its purpose
  • Include all workflow files and templates created
  • Merge the pull request to main branch

Step 5: Test the Workflow Create test issues to demonstrate the issue automation workflow:

  1. Bug Issue: "Bug: Login form validation not working"

    • Expected: bug, priority-high, needs-triageneeds-review, milestone "v1.0.0"
    • Auto-response comment must contain "Bug Report Guidelines"
  2. Epic Issue: "Epic: Redesign user dashboard interface"

    • Expected: epic, priority-high, needs-triageneeds-review, milestone "v1.0.0"
    • Must create 4 sub-issues with enhancement and needs-review labels
    • Parent updated with "## Epic Tasks" checklist, sub-issues linked with "Related to #[parent-number]"
    • Auto-response comment must contain "Feature Request Process"
  3. Maintenance Issue: "Weekly maintenance cleanup and refactor"

    • Expected: maintenance, priority-medium, needs-triageneeds-review, no milestone
    • Auto-response comment must contain "Maintenance Guidelines"


Verify

*.py
Python
import sys
import os
import requests
import time
from typing import Dict, List, Optional, Tuple
from dotenv import load_dotenv


def _get_github_api(
    endpoint: str, headers: Dict[str, str], owner: str, repo: str
) -> Tuple[bool, Optional[Dict]]:
    """Make a GET request to GitHub API and return (success, response)."""
    url = f"https://api.github.com/repos/{owner}/{repo}/{endpoint}"
    try:
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            return True, response.json()
        elif response.status_code == 404:
            return False, None
        else:
            print(f"API error for {endpoint}: {response.status_code}", file=sys.stderr)
            return False, None
    except Exception as e:
        print(f"Exception for {endpoint}: {e}", file=sys.stderr)
        return False, None


def _search_github_issues(
    query: str, headers: Dict[str, str]
) -> Tuple[bool, Optional[List]]:
    """Search GitHub issues using the search API."""
    url = f"https://api.github.com/search/issues?q={query}&per_page=100"
    try:
        response = requests.get(url, headers=headers)
        if response.status_code == 200:
            data = response.json()
            return True, data.get("items", [])
        else:
            print(f"Search API error: {response.status_code}", file=sys.stderr)
            return False, None
    except Exception as e:
        print(f"Search exception: {e}", file=sys.stderr)
        return False, None


def _wait_for_workflow_completion(
    headers: Dict[str, str], owner: str, repo: str, max_wait: int = 180
) -> bool:
    """Wait for GitHub Actions workflows to complete processing."""
    print("⏳ Waiting for GitHub Actions workflows to complete...")

    start_time = time.time()
    expected_runs = 3  # We created 3 test issues
    no_workflow_check_count = 0

    while time.time() - start_time < max_wait:
        try:
            # Check workflow runs
            success, response = _get_github_api(
                "actions/workflows/issue-automation.yml/runs?per_page=20",
                headers,
                owner,
                repo,
            )

            if success and response:
                runs = response.get("workflow_runs", [])
                if len(runs) >= expected_runs:
                    # Check status of recent runs
                    recent_runs = runs[:expected_runs]

                    running_count = 0
                    completed_count = 0
                    failed_count = 0

                    for run in recent_runs:
                        status = run["status"]
                        conclusion = run.get("conclusion")

                        if status == "completed":
                            completed_count += 1
                            if conclusion == "failure":
                                failed_count += 1
                        elif status in ["in_progress", "queued"]:
                            running_count += 1

                    print(
                        f"   Status: {completed_count} completed, {running_count} running/queued"
                    )

                    # Wait until NO workflows are running and we have enough completed runs
                    if running_count == 0 and completed_count >= expected_runs:
                        if failed_count > 0:
                            print(
                                f"⚠️ Warning: {failed_count} workflow runs failed, but continuing verification..."
                            )

                        print(
                            f"✅ All workflows completed. Found {completed_count} completed runs."
                        )
                        # Additional wait to ensure all issue processing is done
                        print("⏳ Additional wait for issue processing to complete...")
                        time.sleep(5)
                        return True
                elif len(runs) == 0:
                    # No workflow runs found
                    no_workflow_check_count += 1
                    if no_workflow_check_count == 1:
                        print(
                            "   No workflow runs found yet, waiting 5 seconds and checking once more..."
                        )
                        time.sleep(5)
                        continue
                    elif no_workflow_check_count >= 2:
                        print(
                            "⚠️ No workflow runs detected after 2 checks. Workflow may not have been triggered."
                        )
                        print("   Continuing with verification...")
                        return False
                else:
                    print(
                        f"   Waiting for workflow runs... Found {len(runs)}, expected {expected_runs}"
                    )

            print(f"⏳ Still waiting... ({int(time.time() - start_time)}s elapsed)")
            time.sleep(5)

        except Exception as e:
            print(f"⚠️ Error checking workflow status: {e}")
            time.sleep(5)

    print(f"⚠️ Workflow completion wait timed out after {max_wait}s")
    return False


def _find_issue_by_title(
    title: str, headers: Dict[str, str], owner: str, repo: str
) -> Optional[Dict]:
    """Find an issue by exact title match."""
    success, issues = _search_github_issues(
        f'repo:{owner}/{repo} "{title}" is:issue', headers
    )

    if success and issues:
        for issue in issues:
            if issue.get("title") == title:
                return issue
    return None


def _check_issue_labels(
    issue: Dict, expected_labels: List[str]
) -> Tuple[bool, List[str]]:
    """Check if issue has the expected labels."""
    actual_labels = [label["name"] for label in issue.get("labels", [])]
    missing_labels = [label for label in expected_labels if label not in actual_labels]

    if missing_labels:
        return False, [f"Missing labels: {missing_labels}. Found: {actual_labels}"]
    return True, []


def _check_issue_milestone(
    issue: Dict, expected_milestone: str
) -> Tuple[bool, List[str]]:
    """Check if issue has the expected milestone."""
    milestone = issue.get("milestone")
    if not milestone:
        if expected_milestone:
            return False, [f"No milestone found. Expected: {expected_milestone}"]
        return True, []

    if milestone.get("title") != expected_milestone:
        return False, [
            f"Wrong milestone: {milestone.get('title')}. Expected: {expected_milestone}"
        ]

    return True, []


def _check_issue_comments(
    issue_number: int,
    expected_content: str,
    headers: Dict[str, str],
    owner: str,
    repo: str,
) -> Tuple[bool, List[str]]:
    """Check if issue has a comment containing expected content."""
    success, comments = _get_github_api(
        f"issues/{issue_number}/comments", headers, owner, repo
    )

    if not success:
        return False, ["Failed to get issue comments"]

    if not comments:
        return False, [f"No comments found. Expected comment with: {expected_content}"]

    for comment in comments:
        if expected_content in comment.get("body", ""):
            return True, []

    return False, [f"Expected content '{expected_content}' not found in comments"]


def _find_epic_sub_issues(
    parent_issue_number: int, headers: Dict[str, str], owner: str, repo: str
) -> Tuple[List[Dict], List[str]]:
    """Find sub-issues created for an epic."""
    # Search for each expected sub-task by exact title
    expected_subtasks = [
        "[SUBTASK] Epic: Redesign user dashboard interface - Task 1: Requirements Analysis",
        "[SUBTASK] Epic: Redesign user dashboard interface - Task 2: Design and Architecture",
        "[SUBTASK] Epic: Redesign user dashboard interface - Task 3: Implementation",
        "[SUBTASK] Epic: Redesign user dashboard interface - Task 4: Testing and Documentation",
    ]

    subtasks = []
    errors = []

    for expected_title in expected_subtasks:
        # Search for exact title
        success, issues = _search_github_issues(
            f'repo:{owner}/{repo} "{expected_title}" is:issue', headers
        )

        if not success:
            errors.append(f"Failed to search for sub-issue: {expected_title}")
            continue

        # Find exact match
        found = False
        for issue in issues:
            if issue.get("title") == expected_title:
                # Verify it references the parent issue
                body = issue.get("body", "")
                if (
                    f"#{parent_issue_number}" in body
                    or f"Related to #{parent_issue_number}" in body
                ):
                    subtasks.append(issue)
                    found = True
                    break

        if not found:
            errors.append(
                f"Sub-issue not found or doesn't reference parent: {expected_title}"
            )

    return subtasks, errors


def _check_epic_checklist(
    issue: Dict, subtask_numbers: List[int]
) -> Tuple[bool, List[str]]:
    """Check if epic issue has the Epic Tasks checklist with correct issue references."""
    body = issue.get("body", "")
    errors = []

    if "## Epic Tasks" not in body:
        return False, ["Epic Tasks section not found in issue body"]

    # Check that all subtask issue numbers are referenced in checkbox format
    for number in subtask_numbers:
        # Check for checkbox format: - [ ] #number
        if f"- [ ] #{number}" not in body:
            errors.append(
                f"Sub-issue #{number} not found in Epic Tasks checklist format (expected: '- [ ] #{number}')"
            )

    # Also verify the expected task names are present
    expected_tasks = [
        "Requirements Analysis",
        "Design and Architecture",
        "Implementation",
        "Testing and Documentation",
    ]

    for task in expected_tasks:
        if task not in body:
            errors.append(f"Task name '{task}' not found in Epic Tasks section")

    if errors:
        return False, errors

    return True, []


def _verify_bug_issue(
    headers: Dict[str, str], owner: str, repo: str
) -> Tuple[bool, List[str]]:
    """Verify the bug issue requirements."""
    print("\n🐛 Verifying Bug Issue...")
    errors = []

    # Find bug issue
    bug_issue = _find_issue_by_title(
        "Bug: Login form validation not working", headers, owner, repo
    )
    if not bug_issue:
        return False, ["Bug issue 'Bug: Login form validation not working' not found"]

    issue_number = bug_issue["number"]
    print(f"   Found bug issue #{issue_number}")

    # Check labels (including first-time-contributor since it's the first issue)
    expected_labels = ["bug", "priority-high", "needs-review", "first-time-contributor"]
    labels_ok, label_errors = _check_issue_labels(bug_issue, expected_labels)
    if not labels_ok:
        errors.extend(label_errors)
    else:
        print(f"   ✅ Labels verified: {expected_labels}")

    # Check milestone
    milestone_ok, milestone_errors = _check_issue_milestone(bug_issue, "v1.0.0")
    if not milestone_ok:
        errors.extend(milestone_errors)
    else:
        print("   ✅ Milestone verified: v1.0.0")

    # Check comment
    comment_ok, comment_errors = _check_issue_comments(
        issue_number, "Bug Report Guidelines", headers, owner, repo
    )
    if not comment_ok:
        errors.extend(comment_errors)
    else:
        print("   ✅ Bug Report Guidelines comment found")

    return len(errors) == 0, errors


def _verify_epic_issue(
    headers: Dict[str, str], owner: str, repo: str
) -> Tuple[bool, List[str]]:
    """Verify the epic issue requirements."""
    print("\n🚀 Verifying Epic Issue...")
    errors = []

    # Find epic issue
    epic_issue = _find_issue_by_title(
        "Epic: Redesign user dashboard interface", headers, owner, repo
    )
    if not epic_issue:
        return False, ["Epic issue 'Epic: Redesign user dashboard interface' not found"]

    issue_number = epic_issue["number"]
    print(f"   Found epic issue #{issue_number}")

    # Check labels
    expected_labels = ["epic", "priority-high", "needs-review"]
    labels_ok, label_errors = _check_issue_labels(epic_issue, expected_labels)
    if not labels_ok:
        errors.extend(label_errors)
    else:
        print(f"   ✅ Labels verified: {expected_labels}")

    # Check milestone
    milestone_ok, milestone_errors = _check_issue_milestone(epic_issue, "v1.0.0")
    if not milestone_ok:
        errors.extend(milestone_errors)
    else:
        print("   ✅ Milestone verified: v1.0.0")

    # Check comment
    comment_ok, comment_errors = _check_issue_comments(
        issue_number, "Feature Request Process", headers, owner, repo
    )
    if not comment_ok:
        errors.extend(comment_errors)
    else:
        print("   ✅ Feature Request Process comment found")

    # Find and verify sub-issues
    sub_issues, sub_errors = _find_epic_sub_issues(issue_number, headers, owner, repo)
    if sub_errors:
        errors.extend(sub_errors)
    elif len(sub_issues) != 4:
        errors.append(f"Expected 4 sub-issues, found {len(sub_issues)}")
    else:
        print(f"   ✅ Found {len(sub_issues)} sub-issues")

        # Collect sub-issue numbers for checklist verification
        subtask_numbers = []

        # Verify each sub-issue has correct labels and link to parent
        for sub_issue in sub_issues:
            sub_number = sub_issue["number"]
            subtask_numbers.append(sub_number)

            # Check labels
            sub_labels = [label["name"] for label in sub_issue.get("labels", [])]
            expected_sub_labels = ["enhancement", "needs-review"]

            missing_sub_labels = [
                label for label in expected_sub_labels if label not in sub_labels
            ]
            if missing_sub_labels:
                errors.append(
                    f"Sub-issue #{sub_number} missing labels: {missing_sub_labels}"
                )

            # Verify parent reference in body
            sub_body = sub_issue.get("body", "")
            if (
                f"#{issue_number}" not in sub_body
                and f"Related to #{issue_number}" not in sub_body
            ):
                errors.append(
                    f"Sub-issue #{sub_number} doesn't reference parent issue #{issue_number}"
                )

        if not errors:
            print(
                "   ✅ All 4 sub-tasks created with correct labels and parent references"
            )

        # Check Epic Tasks checklist with correct issue numbers
        checklist_ok, checklist_errors = _check_epic_checklist(
            epic_issue, subtask_numbers
        )
        if not checklist_ok:
            errors.extend(checklist_errors)
        else:
            print(
                f"   ✅ Epic Tasks checklist verified with correct issue references: {subtask_numbers}"
            )

    return len(errors) == 0, errors


def _verify_maintenance_issue(
    headers: Dict[str, str], owner: str, repo: str
) -> Tuple[bool, List[str]]:
    """Verify the maintenance issue requirements."""
    print("\n🔧 Verifying Maintenance Issue...")
    errors = []

    # Find maintenance issue
    maintenance_issue = _find_issue_by_title(
        "Weekly maintenance cleanup and refactor", headers, owner, repo
    )
    if not maintenance_issue:
        return False, [
            "Maintenance issue 'Weekly maintenance cleanup and refactor' not found"
        ]

    issue_number = maintenance_issue["number"]
    print(f"   Found maintenance issue #{issue_number}")

    # Check labels
    expected_labels = ["maintenance", "priority-medium", "needs-review"]
    labels_ok, label_errors = _check_issue_labels(maintenance_issue, expected_labels)
    if not labels_ok:
        errors.extend(label_errors)
    else:
        print(f"   ✅ Labels verified: {expected_labels}")

    # Check NO milestone (maintenance issues shouldn't get v1.0.0)
    milestone_ok, milestone_errors = _check_issue_milestone(maintenance_issue, None)
    if not milestone_ok:
        errors.extend(milestone_errors)
    else:
        print("   ✅ No milestone assigned (correct for maintenance issue)")

    # Check comment
    comment_ok, comment_errors = _check_issue_comments(
        issue_number, "Maintenance Guidelines", headers, owner, repo
    )
    if not comment_ok:
        errors.extend(comment_errors)
    else:
        print("   ✅ Maintenance Guidelines comment found")

    return len(errors) == 0, errors


def verify() -> bool:
    """
    Verify that the issue management workflow automation is working correctly.
    """
    # Load environment variables
    load_dotenv(".mcp_env")

    github_token = os.environ.get("MCP_GITHUB_TOKEN")
    if not github_token:
        print("Error: MCP_GITHUB_TOKEN environment variable not set", file=sys.stderr)
        return False

    # Get GitHub organization
    github_org = os.environ.get("GITHUB_EVAL_ORG")
    if not github_org:
        print("Error: GITHUB_EVAL_ORG environment variable not set", file=sys.stderr)
        return False

    # Repository configuration
    owner = github_org
    repo = "mcpmark-cicd"

    headers = {
        "Authorization": f"token {github_token}",
        "Accept": "application/vnd.github.v3+json",
    }

    print("🔍 Starting Issue Management Workflow Verification")
    print("=" * 60)

    # Wait for workflows to complete
    workflows_completed = _wait_for_workflow_completion(headers, owner, repo)
    if not workflows_completed:
        print(
            "⚠️ Warning: Workflows may still be running. Continuing with verification..."
        )

    # Verify each test issue
    all_passed = True

    # 1. Verify bug issue
    bug_ok, bug_errors = _verify_bug_issue(headers, owner, repo)
    if not bug_ok:
        all_passed = False
        print("❌ Bug Issue Verification Failed:")
        for error in bug_errors:
            print(f"   - {error}")
    else:
        print("✅ Bug Issue Verification Passed")

    # 2. Verify epic issue
    epic_ok, epic_errors = _verify_epic_issue(headers, owner, repo)
    if not epic_ok:
        all_passed = False
        print("❌ Epic Issue Verification Failed:")
        for error in epic_errors:
            print(f"   - {error}")
    else:
        print("✅ Epic Issue Verification Passed")

    # 3. Verify maintenance issue
    maintenance_ok, maintenance_errors = _verify_maintenance_issue(headers, owner, repo)
    if not maintenance_ok:
        all_passed = False
        print("❌ Maintenance Issue Verification Failed:")
        for error in maintenance_errors:
            print(f"   - {error}")
    else:
        print("✅ Maintenance Issue Verification Passed")

    print("\n" + "=" * 60)
    if all_passed:
        print("🎉 All Issue Management Workflow verifications PASSED!")
        print("\n📋 Summary:")
        print(
            "   ✅ Bug issue: labels (including first-time-contributor), milestone, and auto-response verified"
        )
        print(
            "   ✅ Epic issue: labels, milestone, 4 sub-issues with checklist, and correct issue references verified"
        )
        print(
            "   ✅ Maintenance issue: labels, no milestone, and auto-response verified"
        )
        print("\n🤖 The GitHub Actions workflow automation is working correctly!")
    else:
        print("❌ Issue Management Workflow verification FAILED!")
        print("   Some issues did not meet the expected automation requirements.")

    return all_passed


if __name__ == "__main__":
    success = verify()
    sys.exit(0 if success else 1)