- introduce new mode configuration (replaces commitMode) with the option for PR, COMMIT or HYBRID (whereas hybrid has commits and PRs alongside)
- introduce new default commit configuration automatically used if `COMMIT` mode is configured. this uses a label extractor to support conventional commits
This commit is contained in:
+7
-4
@@ -1,6 +1,6 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import {mergeConfiguration, parseConfiguration, resolveConfiguration, retrieveRepositoryPath, writeOutput} from './utils'
|
||||
import {mergeConfiguration, parseConfiguration, resolveConfiguration, resolveMode, retrieveRepositoryPath, writeOutput} from './utils'
|
||||
import {ReleaseNotesBuilder} from './releaseNotesBuilder'
|
||||
import {Configuration} from './configuration'
|
||||
import {GithubRepository} from './repositories/GithubRepository'
|
||||
@@ -51,8 +51,12 @@ async function run(): Promise<void> {
|
||||
core.info(`ℹ️ No configuration provided. Using Defaults.`)
|
||||
}
|
||||
|
||||
// mode of the action (PR, COMMIT, HYBRID)
|
||||
const mode = resolveMode(core.getInput('mode'), core.getInput('commitMode') === 'true')
|
||||
core.info(`ℹ️ Running in ${mode} mode.`)
|
||||
|
||||
// merge configs, use default values from DefaultConfig on missing definition
|
||||
const configuration = mergeConfiguration(configJson, configFile)
|
||||
const configuration = mergeConfiguration(configJson, configFile, mode)
|
||||
|
||||
// read in repository inputs
|
||||
const baseUrl = core.getInput('baseUrl')
|
||||
@@ -70,7 +74,6 @@ async function run(): Promise<void> {
|
||||
const fetchReviewers = core.getInput('fetchReviewers') === 'true'
|
||||
const fetchReleaseInformation = core.getInput('fetchReleaseInformation') === 'true'
|
||||
const fetchReviews = core.getInput('fetchReviews') === 'true'
|
||||
const commitMode = core.getInput('commitMode') === 'true'
|
||||
const exportCache = core.getInput('exportCache') === 'true'
|
||||
const exportOnly = core.getInput('exportOnly') === 'true'
|
||||
const cache = core.getInput('cache')
|
||||
@@ -91,7 +94,7 @@ async function run(): Promise<void> {
|
||||
fetchReviewers,
|
||||
fetchReleaseInformation,
|
||||
fetchReviews,
|
||||
commitMode,
|
||||
mode,
|
||||
exportCache,
|
||||
exportOnly,
|
||||
cache,
|
||||
|
||||
Reference in New Issue
Block a user