( commits: LocalCommit[] | PartialCommitResponse[], version: string )
| 229 | } |
| 230 | |
| 231 | async function checkCommits( |
| 232 | commits: LocalCommit[] | PartialCommitResponse[], |
| 233 | version: string |
| 234 | ) { |
| 235 | try { |
| 236 | startGroup( |
| 237 | `Searching in ${commits.length} commit${ |
| 238 | commits.length == 1 ? '' : 's' |
| 239 | }...` |
| 240 | ) |
| 241 | info(`Package file name: "${packageFileName}"`) |
| 242 | info( |
| 243 | `Package file URL: ${ |
| 244 | packageFileURL ? `"${packageFileURL}"` : 'undefined' |
| 245 | }` |
| 246 | ) |
| 247 | info( |
| 248 | `Version assumptions: ${ |
| 249 | assumeSameVersion ? `"${assumeSameVersion}"` : 'undefined' |
| 250 | }` |
| 251 | ) |
| 252 | for (const commit of commits) { |
| 253 | const { message, sha } = getBasicInfo(commit) |
| 254 | const match: string[] = message.match(semverReGlobal) || [] |
| 255 | if (match.includes(version)) { |
| 256 | if (await checkDiff(sha, version)) { |
| 257 | endGroup() |
| 258 | info( |
| 259 | `Found match for version ${version}: ${sha.substring( |
| 260 | 0, |
| 261 | 7 |
| 262 | )} ${message}` |
| 263 | ) |
| 264 | return true |
| 265 | } |
| 266 | } |
| 267 | } |
| 268 | endGroup() |
| 269 | |
| 270 | if (getBooleanInput('diff-search')) { |
| 271 | info( |
| 272 | 'No standard npm version commit found, switching to diff search (this could take more time...)' |
| 273 | ) |
| 274 | |
| 275 | if (!isLocalCommitArray(commits)) { |
| 276 | commits = commits.sort( |
| 277 | (a, b) => |
| 278 | new Date(b.commit.committer.date).getTime() - |
| 279 | new Date(a.commit.committer.date).getTime() |
| 280 | ) |
| 281 | } |
| 282 | |
| 283 | startGroup( |
| 284 | `Checking the diffs of ${commits.length} commit${ |
| 285 | commits.length == 1 ? '' : 's' |
| 286 | }...` |
| 287 | ) |
| 288 | for (const commit of commits) { |
no test coverage detected