Support cross-repo issue links in check-pr-issue-link#3
Draft
Support cross-repo issue links in check-pr-issue-link#3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5
Summary
check-pr-issue-linkto recognize cross-repo closing references (e.g.Closes org/repofollowed by the number) alongside the existing same-repo form.GITHUB_TOKENcannot see) are treated the same as same-repo 404s — reported as not found.Notable changes
LINK_REGEXbroadened. The alternation(?:owner/repo#|#?)keeps the hash optional for same-repo refs and required for cross-repo refs in a single pattern.{ owner, repo, number, isCrossRepo }references, deduped by the full owner/repo/number tuple.Supported reference formssection and a cross-repo example.Test plan
Verified end-to-end in a sandbox caller repo pointing
uses:at this branch. All five states produced the expected comment/label:Missing Issue Linkcomment +needs-issue-linklabel.Invalid Issue Referencecomment in the new cross-repo wording; label applied.Heads-upcomment listing only the cross-repo invalid; label removed.Note: the PR description intentionally avoids bare issue tokens in prose — the workflow scans all text (including inline code), so any
#Norowner/repo#Nwould be treated as a real reference.