@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2016 Mike Penz
|
||||
Copyright 2021 Mike Penz
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -222,7 +222,7 @@ For advanced use cases additional settings can be provided to the action
|
||||
|
||||
### PR Template placeholders
|
||||
|
||||
Table of supported placeholders allowed to be used in the `pr_template` configuration.
|
||||
Table of supported placeholders allowed to be used in the `pr_template` configuration, which will be included in the release notes / changelog.
|
||||
|
||||
| **Placeholder** | **Description** |
|
||||
|------------------|-------------------------------------------------------------|
|
||||
@@ -239,7 +239,7 @@ Table of supported placeholders allowed to be used in the `pr_template` configur
|
||||
|
||||
### Template placeholders
|
||||
|
||||
Table of supported placeholders allowed to be used in the `template` and `empty_template` (only supports placeholder marked for empty) configuration.
|
||||
Table of supported placeholders allowed to be used in the `template` and `empty_template` (only supports placeholder marked for empty) configuration, to give additional control on defining the contents of the release notes / changelog.
|
||||
|
||||
| **Placeholder** | **Description** | **Empty** |
|
||||
|----------------------------|----------------------------------------------------------------------------------------------------|:---------:|
|
||||
@@ -257,7 +257,7 @@ Table of supported placeholders allowed to be used in the `template` and `empty_
|
||||
|
||||
### Configuration Specification
|
||||
|
||||
Table of descriptions for the `configuration.json` options.
|
||||
Table of descriptions for the `configuration.json` options to configure the resulting release notes / changelog.
|
||||
|
||||
| **Input** | **Description** |
|
||||
|--------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
@@ -316,13 +316,13 @@ export GITHUB_TOKEN=your_personal_github_pat
|
||||
## License
|
||||
|
||||
Copyright for portions of pr-release-notes are held by Nikolay Blagoev, 2019-2020 as part of project pull-release-notes.
|
||||
All other copyright for project pr-release-notes are held by Mike Penz, 2020.
|
||||
All other copyright for project pr-release-notes are held by Mike Penz, 2021.
|
||||
|
||||
## Fork License
|
||||
|
||||
All patches and changes applied to the original source are licensed under the Apache 2.0 license.
|
||||
|
||||
Copyright 2020 Mike Penz
|
||||
Copyright 2021 Mike Penz
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -336,7 +336,7 @@ All patches and changes applied to the original source are licensed under the Ap
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
## Sample result changelog
|
||||
## Sample result release notes / changelog
|
||||
|
||||
<div align="center">
|
||||
<a href="https://github.com/mikepenz/release-changelog-builder-action/runs/1270879787"><img src=".github/images/release_changelog_builder_expanded.png"/></a>
|
||||
|
||||
+11
-6
@@ -333,7 +333,7 @@ function run() {
|
||||
core.setOutput('changelog', result);
|
||||
// write the result in changelog to file if possible
|
||||
const outputFile = core.getInput('outputFile');
|
||||
if (outputFile !== "") {
|
||||
if (outputFile !== '') {
|
||||
core.debug(`Enabled writing the changelog to disk`);
|
||||
utils_1.writeOutput(repositoryPath, outputFile, result);
|
||||
}
|
||||
@@ -1231,10 +1231,7 @@ function resolveConfiguration(githubWorkspacePath, configurationFile) {
|
||||
const configurationPath = path.resolve(githubWorkspacePath, configurationFile);
|
||||
core.debug(`configurationPath = '${configurationPath}'`);
|
||||
const providedConfiguration = readConfiguration(configurationPath);
|
||||
if (!providedConfiguration) {
|
||||
core.info(`⚠️ Configuration provided, but it couldn't be found, or failed to parse. Fallback to Defaults`);
|
||||
}
|
||||
else {
|
||||
if (providedConfiguration) {
|
||||
configuration = providedConfiguration;
|
||||
}
|
||||
}
|
||||
@@ -1245,12 +1242,20 @@ exports.resolveConfiguration = resolveConfiguration;
|
||||
* Reads in the configuration from the JSON file
|
||||
*/
|
||||
function readConfiguration(filename) {
|
||||
let rawdata;
|
||||
try {
|
||||
rawdata = fs.readFileSync(filename, 'utf8');
|
||||
}
|
||||
catch (error) {
|
||||
core.info(`⚠️ Configuration provided, but it couldn't be found. Fallback to Defaults.`);
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
const rawdata = fs.readFileSync(filename, 'utf8');
|
||||
const configurationJSON = JSON.parse(rawdata);
|
||||
return configurationJSON;
|
||||
}
|
||||
catch (error) {
|
||||
core.info(`⚠️ Configuration provided, but it couldn't be parsed. Fallback to Defaults.`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Generated
+505
-2871
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -42,15 +42,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.19",
|
||||
"@types/node": "^14.14.16",
|
||||
"@typescript-eslint/parser": "^4.11.1",
|
||||
"@types/node": "^14.14.20",
|
||||
"@typescript-eslint/parser": "^4.12.0",
|
||||
"@vercel/ncc": "^0.26.1",
|
||||
"eslint": "^7.16.0",
|
||||
"eslint": "^7.17.0",
|
||||
"eslint-plugin-github": "^4.1.1",
|
||||
"eslint-plugin-jest": "^24.1.3",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"js-yaml": "^3.14.1",
|
||||
"js-yaml": "^4.0.0",
|
||||
"prettier": "2.2.1",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.1.3"
|
||||
|
||||
+13
-6
@@ -51,11 +51,7 @@ export function resolveConfiguration(
|
||||
)
|
||||
core.debug(`configurationPath = '${configurationPath}'`)
|
||||
const providedConfiguration = readConfiguration(configurationPath)
|
||||
if (!providedConfiguration) {
|
||||
core.info(
|
||||
`⚠️ Configuration provided, but it couldn't be found, or failed to parse. Fallback to Defaults`
|
||||
)
|
||||
} else {
|
||||
if (providedConfiguration) {
|
||||
configuration = providedConfiguration
|
||||
}
|
||||
}
|
||||
@@ -66,11 +62,22 @@ export function resolveConfiguration(
|
||||
* Reads in the configuration from the JSON file
|
||||
*/
|
||||
function readConfiguration(filename: string): Configuration | null {
|
||||
let rawdata: string
|
||||
try {
|
||||
rawdata = fs.readFileSync(filename, 'utf8')
|
||||
} catch (error) {
|
||||
core.info(
|
||||
`⚠️ Configuration provided, but it couldn't be found. Fallback to Defaults.`
|
||||
)
|
||||
return null
|
||||
}
|
||||
try {
|
||||
const rawdata = fs.readFileSync(filename, 'utf8')
|
||||
const configurationJSON: Configuration = JSON.parse(rawdata)
|
||||
return configurationJSON
|
||||
} catch (error) {
|
||||
core.info(
|
||||
`⚠️ Configuration provided, but it couldn't be parsed. Fallback to Defaults.`
|
||||
)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user