( github: Octokit, card: Card )
| 76 | } |
| 77 | |
| 78 | async function cardToMergedCommit( |
| 79 | github: Octokit, |
| 80 | card: Card |
| 81 | ): Promise<PullRequest | undefined> { |
| 82 | const issueNumber = card.content_url?.split('/').pop(); |
| 83 | const { data: pullRequest } = await github.pulls.get({ |
| 84 | owner: OWNER, |
| 85 | repo: REPO, |
| 86 | pull_number: Number(issueNumber) |
| 87 | }); |
| 88 | |
| 89 | if (!pullRequest?.merged) { |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | return pullRequest; |
| 94 | } |
| 95 | |
| 96 | function sortCommits(a: CardCommit, b: CardCommit) { |
| 97 | const aDate = new Date(a.commit.merged_at || ''); |
no test coverage detected