(commits, nodes)
| 32 | } |
| 33 | |
| 34 | function collectCommits(commits, nodes) { |
| 35 | for (const node of nodes) { |
| 36 | const commit = node && node.commit; |
| 37 | if (!commit || !/^[0-9a-f]{40}$/.test(commit.oid) || |
| 38 | typeof commit.message !== "string" || commits.has(commit.oid)) { |
| 39 | throw new Error("Invalid or duplicate PR commit data. Re-run PR Commit Policy."); |
| 40 | } |
| 41 | commits.set(commit.oid, commit); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | async function readComparison(github, variables, snapshot) { |
| 46 | const commits = new Map(); |
no test coverage detected