MCPcopy Create free account
hub / github.com/alibaba/open-code-review / collectCommits

Function collectCommits

scripts/github-actions/check-pr-commit-policy.js:34–43  ·  view source on GitHub ↗
(commits, nodes)

Source from the content-addressed store, hash-verified

32}
33
34function 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
45async function readComparison(github, variables, snapshot) {
46 const commits = new Map();

Callers 2

readComparisonFunction · 0.85
readPullRequestFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected