Linking Issues

Linking Pull Requests to Issues and Projects

A closing keyword in the description (Auto-Closing Issues) links a pull request to the issue under Development and closes the issue when the pull request merges into the default branch:

Which pull request closed which issueShell
gh issue list --state closed --milestone 1.2.0 --json number,closedByPullRequestsReferences \
  --jq '.[] | "#\(.number) <- \([.closedByPullRequestsReferences[].number])"'
Output
#5 <- [8]
#2 <- [7]
#1 <- []

Issue #1 was closed by a commit, so its list is empty. The milestone now counts five closed items, pull requests included, with only the tracking issue #6 open. Anyone with write access can also link up to ten issues by hand under Development, which suits pull requests to other branches, where keywords are ignored. gh 29 pr edit 7 --add-project "BookNest 1.2" would add a pull request to a project (Project Boards), which moves it to Done on merge; this token cannot write user-owned projects, so that is not run here.