Skip to content

script-utils/released-issues

Closes the GitHub issues a release carries, with a comment linking the release.

An issue that a commit in the release names with a closing keyword (fixes #12, closes #12, resolves #12, and their other tenses) is closed as completed, with Fixed in <release URL> when it carries a bug label and Implemented in <release URL> otherwise. The URL is the releases/tag/<version> page, which exists by the time this runs.

Only a closing keyword closes anything. A bare mention (re #12, (#12), the issue URL) is often one step of unfinished work, and this module cannot know whether the rest has landed, so such an issue is listed as left open and nothing is posted to it.

GitHub itself closes an issue named with a closing keyword as soon as the commit reaches the default branch — before the release, and without saying which release carries the change. So an issue that is already closed as completed still gets the release link, unless one of its comments already carries this release’s URL, which also makes a second run post nothing.

Interface Description
CloseReleasedIssuesParams Params for closeReleasedIssues.
GetIssueReferencesParams Params for getIssueReferences.
IssueReference An issue number named by the commit messages of a release.
Function Description
closeReleasedIssues Closes the issues the release of CloseReleasedIssuesParams.newVersion carries, as described in the file overview. A failure to read or update one issue is reported and the rest are still processed, because the release is already published by the time this runs and nothing about it can be undone.
getIssueReferences Collects the issue numbers of one repository that a set of commit messages names, and whether each was named with a closing keyword. Three forms count: a bare #12, <owner>/<name>#12, and the repository’s issues/12 or pull/12 URL. A bare #12 glued to a preceding token (other#12, other/repo#12, &#12) does not. A mention is closing when GitHub’s own closing keyword precedes it directly: close, closes, closed, fix, fixes, fixed, resolve, resolves or resolved, in any case, optionally followed by a colon.