- add support to exclude merge commits in release notes generation
- move filterCommits into commits.ts - recompile dist files with updated code
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {Octokit, RestEndpointMethodTypes} from '@octokit/rest'
|
||||
import moment from 'moment'
|
||||
|
||||
import {CommitInfo} from './commits'
|
||||
import * as core from '@actions/core'
|
||||
|
||||
export interface PullRequestInfo {
|
||||
@@ -129,34 +128,6 @@ export class PullRequests {
|
||||
|
||||
return sortPullRequests(mergedPRs, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters out all commits which match the exclude pattern
|
||||
*/
|
||||
filterCommits(
|
||||
commits: CommitInfo[],
|
||||
excludeMergeBranches: string[]
|
||||
): CommitInfo[] {
|
||||
const filteredCommits = []
|
||||
|
||||
for (const commit of commits) {
|
||||
if (excludeMergeBranches) {
|
||||
let matched = false
|
||||
for (const excludeMergeBranch of excludeMergeBranches) {
|
||||
if (commit.summary.includes(excludeMergeBranch)) {
|
||||
matched = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (matched) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
filteredCommits.push(commit)
|
||||
}
|
||||
|
||||
return filteredCommits
|
||||
}
|
||||
}
|
||||
|
||||
export function sortPullRequests(
|
||||
|
||||
Reference in New Issue
Block a user