Skip to content

Recognize all GitHub issue-link forms in require-issue-link workflow - #4359

Merged
jlowin merged 1 commit into
mainfrom
claude/beautiful-noether-8a4d28
Jun 24, 2026
Merged

Recognize all GitHub issue-link forms in require-issue-link workflow#4359
jlowin merged 1 commit into
mainfrom
claude/beautiful-noether-8a4d28

Conversation

@jlowin

@jlowin jlowin commented Jun 24, 2026

Copy link
Copy Markdown
Member

The require-issue-link workflow only recognized the Closes #123 hash form when scanning a PR body for its linked issue. GitHub itself also honors Closes owner/repo#123 and the full Closes https://github.com/owner/repo/issues/123 URL — both of which contributors use. A PR linking its issue via either of those forms was wrongly closed as "no link", and assigning the issue afterward never reopened it (the reopen-on-assignment job re-parsed the body with the same regex and skipped the PR). This is exactly what happened to #4319#4320.

The shared closing-keyword regex (used identically by both jobs) now matches all three forms GitHub recognizes, scoped to the current repo so a cross-repo reference like Closes otherorg/repo#5 is correctly ignored rather than mis-resolved against our own issue numbering.

// before — only `#123`
/(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?\s*#(\d+)/gi

// after — `#123`, `owner/repo#123`, and the full issue URL, same-repo only
const repoRef = `${owner}/${repo}`.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
new RegExp(
  '(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s*:?\\s*' +
    `(?:${repoRef}#|#|https?://github\\.com/${repoRef}/issues/)(\\d+)`,
  'gi',
);

@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. tests labels Jun 24, 2026
@jlowin
jlowin merged commit d773078 into main Jun 24, 2026
14 of 15 checks passed
@jlowin
jlowin deleted the claude/beautiful-noether-8a4d28 branch June 24, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant