- adjust placeholder for yml as ${{}} is reserved

This commit is contained in:
Mike Penz
2022-07-29 09:30:57 +00:00
committed by GitHub
parent 02b79cb00a
commit f55f49981d
5 changed files with 10 additions and 6 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
toTag: "v0.0.3" toTag: "v0.0.3"
configurationJson: | configurationJson: |
{ {
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>", "template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"categories": [ "categories": [
{ {
"title": "## 🚀 Features", "title": "## 🚀 Features",
+2 -2
View File
@@ -147,7 +147,7 @@ jobs:
with: with:
configurationJson: | configurationJson: |
{ {
"template": "${{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n${{UNCATEGORIZED}}\n</details>", "template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"categories": [ "categories": [
{ {
"title": "## 💬 Other", "title": "## 💬 Other",
@@ -301,7 +301,7 @@ For advanced use cases additional settings can be provided to the action
| **Input** | **Description** | | **Input** | **Description** |
|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `configurationJson` | Provide the configuration directly via the build `yml` file. | | `configurationJson` | Provide the configuration directly via the build `yml` file. Please note that `${{}}` has to be written as `#{{}}` within the `yml` file. |
| `configuration` | Relative path, to the `configuration.json` file, providing additional configurations | | `configuration` | Relative path, to the `configuration.json` file, providing additional configurations |
| `outputFile` | Optional relative path to a file to store the resulting changelog in. | | `outputFile` | Optional relative path to a file to store the resulting changelog in. |
| `owner` | The owner of the repository to generate the changelog for | | `owner` | The owner of the repository to generate the changelog for |
Generated Vendored
+2 -1
View File
@@ -1928,7 +1928,8 @@ function readConfiguration(filename) {
*/ */
function parseConfiguration(config) { function parseConfiguration(config) {
try { try {
const configurationJSON = JSON.parse(config); // for compatiblity with the `yml` file we require to use `#{{}}` instead of `${{}}` - replace it here.
const configurationJSON = JSON.parse(config.replace(/#{{/g, '${{'));
return configurationJSON; return configurationJSON;
} }
catch (error) { catch (error) {
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -1
View File
@@ -86,7 +86,10 @@ function readConfiguration(filename: string): Configuration | undefined {
*/ */
export function parseConfiguration(config: string): Configuration | undefined { export function parseConfiguration(config: string): Configuration | undefined {
try { try {
const configurationJSON: Configuration = JSON.parse(config) // for compatiblity with the `yml` file we require to use `#{{}}` instead of `${{}}` - replace it here.
const configurationJSON: Configuration = JSON.parse(
config.replace(/#{{/g, '${{')
)
return configurationJSON return configurationJSON
} catch (error) { } catch (error) {
core.info( core.info(