- introduce better more stable fallbacks in case the configuration is missing

- move configurations into subfolder for easier discovery
- simplify missing value fallback specification
This commit is contained in:
Mike Penz
2020-10-17 18:02:08 +02:00
parent 619d3f460e
commit b464ff088a
8 changed files with 140 additions and 68 deletions
+17 -6
View File
@@ -4,6 +4,7 @@ import {ReleaseNotes} from './releaseNotes'
import {createCommandManager} from './git-helper'
import * as github from '@actions/github'
import * as path from 'path'
import {DefaultConfiguration} from './configuration'
async function run(): Promise<void> {
try {
@@ -19,12 +20,22 @@ async function run(): Promise<void> {
core.debug(`repositoryPath = '${repositoryPath}'`)
const configurationFile: string = core.getInput('configuration')
const configurationPath = path.resolve(
githubWorkspacePath,
configurationFile
)
core.debug(`configurationPath = '${configurationPath}'`)
const configuration = readConfiguration(configurationPath)
let configuration = DefaultConfiguration
if (configurationFile) {
const configurationPath = path.resolve(
githubWorkspacePath,
configurationFile
)
core.debug(`configurationPath = '${configurationPath}'`)
const providedConfiguration = readConfiguration(configurationPath)
if (!providedConfiguration) {
core.error(
`Configuration provided, but it couldn't be found, or failed to parse`
)
} else {
configuration = providedConfiguration
}
}
const token = core.getInput('token')
let owner = core.getInput('owner')