Skip to content

fix(success): ignore related issues/PRs that do not exist - #1326

Merged
babblebey merged 2 commits into
semantic-release:fix/successfrom
philsturgeon:fix/ignore-not-found-related-issues
Nov 12, 2026
Merged

babblebey merged 2 commits into
semantic-release:fix/successfrom
philsturgeon:fix/ignore-not-found-related-issues

Conversation

@philsturgeon

@philsturgeon philsturgeon commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

If a commit message references an issue number that doesn't exist in the repository (e.g. closes #3068 copied from another repo, which is common in forks and monorepo migrations), the getRelatedIssues GraphQL query returns partial data plus a NOT_FOUND error. @octokit/graphql throws on any errors, so the whole success step fails:

Error: Could not resolve to an issue or pull request with the number of 3068.
  type: 'NOT_FOUND', path: [ 'repository', 'issue3068' ]

This is inconsistent with the existing handling of missing issues when commenting (404 is logged and ignored, see "Ignore missing and forbidden issues/PRs").

Change

  • Catch the error when resolving related issues. If every error is NOT_FOUND and partial data is present, log the missing numbers and continue with the issues that resolved (null entries are filtered out).
  • Any other error is rethrown unchanged.
  • Added a test; it fails without the fix. npm run lint:prettier and ava (266 tests) pass.

philsturgeon and others added 2 commits October 27, 2026 21:40
A commit message such as "closes semantic-release#123" copied from another repository made the
getRelatedIssues GraphQL query return a NOT_FOUND error, which octokit throws
even though the response carries partial data. That failed the whole success
step. Treat NOT_FOUND-only errors as missing issues, log them, and continue with
the ones that resolved. Any other error is still thrown.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@babblebey
babblebey changed the base branch from master to fix/success November 12, 2026 17:27

@babblebey babblebey left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏾 Thanks

@babblebey
babblebey merged commit 8dc43ad into semantic-release:fix/success Nov 12, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 12.0.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants