Skip to content

Conversation

@CalvinAllen
Copy link
Contributor

Summary

The previous logic checked for commit_id on the closed event, but GitHub doesn't set this when "Closes #X" is in the PR body (only when in commit message).

Now checks for cross-referenced events from merged PRs instead, which correctly detects issues like #1 that were closed via PR #4.

Testing

Verified locally that issue #1 now returns PR #4 as the closing PR:

gh api repos/CodingWithCalvin/VSToolbox/issues/1/timeline --jq '
  [.[] | select(.event == "cross-referenced") |
   select(.source.issue.pull_request.merged_at)] |
  .[0].source.issue.number // empty'
# Returns: 4

The previous logic checked for commit_id on the closed event, but GitHub
doesn't set this when "Closes #X" is in the PR body. Now checks for
cross-referenced events from merged PRs instead.
@CalvinAllen CalvinAllen merged commit 9910dc2 into main Dec 31, 2025
2 checks passed
@CalvinAllen CalvinAllen deleted the feat/more-workflows-v2 branch December 31, 2025 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants