The commit hashes that appear in the `pull/12345/head` ref are the
ones _before_ any final rebase occurs, and as such may not match to
any commit hashes which exist in `main`.
Use the GitHub GraphQL API to pull the last "merge commit" on the PR,
which is post-rebase, and use that as the target commit when
cherry-picking. Then walk backwards from that commit, including every
sequential commit which is still associated with the PR; we do this
because during the merge, commits may be added or removed, so the PR
is not reliable in the commit count.