- 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:
+12
-2
@@ -1,5 +1,5 @@
|
||||
import {Octokit} from '@octokit/rest'
|
||||
import {Commits, CommitInfo} from './commits'
|
||||
import {Commits, CommitInfo, filterCommits} from './commits'
|
||||
import {PullRequestInfo, PullRequests} from './pullRequests'
|
||||
import {buildChangelog} from './transform'
|
||||
import * as core from '@actions/core'
|
||||
@@ -113,7 +113,7 @@ export class ReleaseNotes {
|
||||
`ℹ️ Retrieved ${pullRequests.length} merged PRs for ${owner}/${repo}`
|
||||
)
|
||||
|
||||
const prCommits = pullRequestsApi.filterCommits(
|
||||
const prCommits = filterCommits(
|
||||
commits,
|
||||
configuration.exclude_merge_branches ||
|
||||
DefaultConfiguration.exclude_merge_branches
|
||||
@@ -137,11 +137,21 @@ export class ReleaseNotes {
|
||||
private async generateCommitPRs(
|
||||
octokit: Octokit
|
||||
): Promise<PullRequestInfo[]> {
|
||||
const {owner, repo, configuration} = this.options
|
||||
|
||||
const commits = await this.getCommitHistory(octokit)
|
||||
if (commits.length === 0) {
|
||||
return []
|
||||
}
|
||||
|
||||
const prCommits = filterCommits(
|
||||
commits,
|
||||
configuration.exclude_merge_branches ||
|
||||
DefaultConfiguration.exclude_merge_branches
|
||||
)
|
||||
|
||||
core.info(`ℹ️ Retrieved ${prCommits.length} commits for ${owner}/${repo}`)
|
||||
|
||||
return commits.map(function (commit) {
|
||||
return {
|
||||
number: 0,
|
||||
|
||||
Reference in New Issue
Block a user