Skip to content

Enhancement: Add PR number validation to Copilot follow-up detection #292

@rjmurillo-bot

Description

@rjmurillo-bot

Origin

PR #202 comment 2639354259 from Copilot

Current Behavior

Pattern regex uses \d+ to match any digits in branch name copilot/sub-pr-{number}.

No validation that extracted number matches the original PR number parameter.

Enhancement

Validate extracted PR number:

if ($headRef -match 'copilot/sub-pr-(\d+)') {
    $extractedPR = [int]$matches[1]
    return $extractedPR -eq $PRNumber
}
return $false

Rationale

Prevents false positives if repository has multiple Copilot follow-up branches.

Acceptance Criteria

  • Extract PR number from branch name
  • Compare against $PRNumber parameter
  • Return false if mismatch
  • Add Pester test for validation logic

Metadata

Metadata

Assignees

Labels

agent-qaTesting and verification agentarea-workflowsGitHub Actions workflowsenhancementNew feature or requestpriority:P2Normal: Standard enhancement or bug fix, moderate impact

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions