mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-09 15:19:10 +02:00
Recognize all GitHub issue-link forms in require-issue-link workflow (#4359)
This commit is contained in:
parent
4ce8e2a5d0
commit
d7730788fa
1 changed files with 22 additions and 2 deletions
24
.github/workflows/require-issue-link.yml
vendored
24
.github/workflows/require-issue-link.yml
vendored
|
|
@ -277,7 +277,17 @@ jobs:
|
|||
|
||||
// ── The actual check: an auto-close keyword + issue number ─────
|
||||
const body = pr.body || '';
|
||||
const pattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?\s*#(\d+)/gi;
|
||||
// Match GitHub's auto-close keywords against any reference form
|
||||
// that GitHub itself honors: bare `#123`, the `owner/repo#123`
|
||||
// shorthand, and the full issue URL. Scope the qualified forms to
|
||||
// THIS repo — GitHub only auto-closes same-repo issues, so a
|
||||
// cross-repo reference must not be resolved against our numbering.
|
||||
const repoRef = `${owner}/${repo}`.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
const pattern = new RegExp(
|
||||
'(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s*:?\\s*' +
|
||||
`(?:${repoRef}#|#|https?://github\\.com/${repoRef}/issues/)(\\d+)`,
|
||||
'gi',
|
||||
);
|
||||
const matches = [...body.matchAll(pattern)];
|
||||
|
||||
if (matches.length === 0) {
|
||||
|
|
@ -425,7 +435,17 @@ jobs:
|
|||
const enforce = process.env.ENFORCE_ISSUE_LINK === 'true';
|
||||
const LABEL = 'missing-issue-link';
|
||||
const MARKER = '<!-- require-issue-link -->';
|
||||
const pattern = /(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\s*:?\s*#(\d+)/gi;
|
||||
// Match GitHub's auto-close keywords against any reference form
|
||||
// that GitHub itself honors: bare `#123`, the `owner/repo#123`
|
||||
// shorthand, and the full issue URL. Scope the qualified forms to
|
||||
// THIS repo — GitHub only auto-closes same-repo issues, so a
|
||||
// cross-repo reference must not be resolved against our numbering.
|
||||
const repoRef = `${owner}/${repo}`.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
const pattern = new RegExp(
|
||||
'(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s*:?\\s*' +
|
||||
`(?:${repoRef}#|#|https?://github\\.com/${repoRef}/issues/)(\\d+)`,
|
||||
'gi',
|
||||
);
|
||||
|
||||
async function mutate(description, fn) {
|
||||
if (!enforce) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue