- introduce minimalistic CONTRIBUTORS output for changelogs
- This is based only on PR authors at this time - RELATES TO https://github.com/mikepenz/release-changelog-builder-action/pull/1338 - Thanks @Freezor
This commit is contained in:
@@ -246,7 +246,7 @@ ${{steps.build_changelog.outputs.changelog}}
|
|||||||
A full set list of possible output values for this action.
|
A full set list of possible output values for this action.
|
||||||
|
|
||||||
| **Output** | **Description** |
|
| **Output** | **Description** |
|
||||||
|-----------------------|---------------------------------------------------------------------------------------------------------------------------|
|
|-----------------------------|---------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `outputs.changelog` | The built release changelog built from the merged pull requests |
|
| `outputs.changelog` | The built release changelog built from the merged pull requests |
|
||||||
| `outputs.owner` | Specifies the owner of the repository processed |
|
| `outputs.owner` | Specifies the owner of the repository processed |
|
||||||
| `outputs.repo` | Describes the repository name, which was processed |
|
| `outputs.repo` | Describes the repository name, which was processed |
|
||||||
@@ -262,6 +262,7 @@ A full set list of possible output values for this action.
|
|||||||
| `outputs.deletions` | Count of code deletions in this release (lines). |
|
| `outputs.deletions` | Count of code deletions in this release (lines). |
|
||||||
| `outputs.changes` | Total count of changes in this release (lines). |
|
| `outputs.changes` | Total count of changes in this release (lines). |
|
||||||
| `outputs.commits` | Count of commits which have been added in this release. |
|
| `outputs.commits` | Count of commits which have been added in this release. |
|
||||||
|
| `outputs.contributors` | The contributors of this release. Based on PR authors only. |
|
||||||
| `outputs.categorized` | The categorized pull requests used to build the changelog as serialized JSON. |
|
| `outputs.categorized` | The categorized pull requests used to build the changelog as serialized JSON. |
|
||||||
| `outputs.cache` | The file pointing to the cache for the current fetched data. Can be provided to another action step. |
|
| `outputs.cache` | The file pointing to the cache for the current fetched data. Can be provided to another action step. |
|
||||||
|
|
||||||
@@ -461,6 +462,7 @@ Table of supported placeholders allowed to be used in the `template` and `empty_
|
|||||||
| `#{{DELETIONS}}` | The count of code deletions (lines). | |
|
| `#{{DELETIONS}}` | The count of code deletions (lines). | |
|
||||||
| `#{{CHANGES}}` | The count of total changes (lines). | |
|
| `#{{CHANGES}}` | The count of total changes (lines). | |
|
||||||
| `#{{COMMITS}}` | The count of commits in this release. | |
|
| `#{{COMMITS}}` | The count of commits in this release. | |
|
||||||
|
| `#{{CONTRIBUTORS}}` | The contributors of this release. Based on PR Authors only. | |
|
||||||
| `#{{CATEGORIZED_COUNT}}` | The count of PRs which were categorized | |
|
| `#{{CATEGORIZED_COUNT}}` | The count of PRs which were categorized | |
|
||||||
| `#{{UNCATEGORIZED_COUNT}}` | The count of PRs and changes which were not categorized. No label overlapping with category labels | |
|
| `#{{UNCATEGORIZED_COUNT}}` | The count of PRs and changes which were not categorized. No label overlapping with category labels | |
|
||||||
| `#{{OPEN_COUNT}}` | The count of open PRs. Will only be fetched if `includeOpen` is configured. | |
|
| `#{{OPEN_COUNT}}` | The count of open PRs. Will only be fetched if `includeOpen` is configured. | |
|
||||||
@@ -505,7 +507,7 @@ When using `*` values are joined by `,`.
|
|||||||
| `#{{REVIEWERS[*]}}` | GitHub Login names of specified reviewers. Requires `fetchReviewers` to be enabled. |
|
| `#{{REVIEWERS[*]}}` | GitHub Login names of specified reviewers. Requires `fetchReviewers` to be enabled. |
|
||||||
| `#{{APPROVERS[*]}}` | GitHub Login names of users who approved the PR. |
|
| `#{{APPROVERS[*]}}` | GitHub Login names of users who approved the PR. |
|
||||||
|
|
||||||
Additionally there are special array placeholders like `REVIEWS` which allows access to it's properties via
|
Additionally, there are special array placeholders like `REVIEWS` which allows access to it's properties via
|
||||||
`(KEY)[(*/index)].(property)`.
|
`(KEY)[(*/index)].(property)`.
|
||||||
|
|
||||||
For example: `REVIEWS[*].author` or `REVIEWS[*].body`
|
For example: `REVIEWS[*].author` or `REVIEWS[*].body`
|
||||||
@@ -579,7 +581,7 @@ Since v5.x or newer, the regex configuration was unified to allow the same funct
|
|||||||
This applies to all configurations outlined in `Configuration Specification` and `Custom placeholders` that allow a regex object.
|
This applies to all configurations outlined in `Configuration Specification` and `Custom placeholders` that allow a regex object.
|
||||||
|
|
||||||
| **Input** | **Description** |
|
| **Input** | **Description** |
|
||||||
|-----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| <parent>.pattern | The `regex` pattern to use |
|
| <parent>.pattern | The `regex` pattern to use |
|
||||||
| <parent>.target | The result pattern. The result text will be used as label. If empty, no label is created. (Usage depends on the `method` used for the regex) |
|
| <parent>.target | The result pattern. The result text will be used as label. If empty, no label is created. (Usage depends on the `method` used for the regex) |
|
||||||
| <parent>.method | The extraction method used. Defaults to: `replace`. Alternative values: `replaceAll`, `match`. These methods specified references the JavaScript String method. And a special method `regexr`, that functions similar to the `list` within the regexr tool. |
|
| <parent>.method | The extraction method used. Defaults to: `replace`. Alternative values: `replaceAll`, `match`. These methods specified references the JavaScript String method. And a special method `regexr`, that functions similar to the `list` within the regexr tool. |
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"sort": "ASC",
|
"sort": "ASC",
|
||||||
"template": "${{CHANGELOG}}",
|
"template": "${{CHANGELOG}}\n\nContributors:\n${{CONTRIBUTORS}}",
|
||||||
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}",
|
"pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}",
|
||||||
"empty_template": "- no changes",
|
"empty_template": "- no changes",
|
||||||
"max_pull_requests": 1000,
|
"max_pull_requests": 1000,
|
||||||
|
|||||||
+9
@@ -2786,12 +2786,21 @@ function buildChangelog(diffInfo, origPrs, options) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`);
|
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`);
|
||||||
|
// collect all contributors
|
||||||
|
let contributors = [];
|
||||||
|
for (const pr of prs) {
|
||||||
|
contributors = contributors.concat(pr.author);
|
||||||
|
}
|
||||||
|
const contributorsString = contributors.join(', ');
|
||||||
|
core.setOutput('contributors', JSON.stringify(contributors));
|
||||||
// fill template
|
// fill template
|
||||||
const placeholderMap = new Map();
|
const placeholderMap = new Map();
|
||||||
placeholderMap.set('CHANGELOG', changelog);
|
placeholderMap.set('CHANGELOG', changelog);
|
||||||
placeholderMap.set('UNCATEGORIZED', changelogUncategorized);
|
placeholderMap.set('UNCATEGORIZED', changelogUncategorized);
|
||||||
placeholderMap.set('OPEN', changelogOpen);
|
placeholderMap.set('OPEN', changelogOpen);
|
||||||
placeholderMap.set('IGNORED', changelogIgnored);
|
placeholderMap.set('IGNORED', changelogIgnored);
|
||||||
|
// fill special collected contributors
|
||||||
|
placeholderMap.set('CONTRIBUTORS', contributorsString);
|
||||||
// fill other placeholders
|
// fill other placeholders
|
||||||
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString());
|
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString());
|
||||||
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString());
|
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString());
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -275,12 +275,22 @@ export function buildChangelog(diffInfo: DiffInfo, origPrs: PullRequestInfo[], o
|
|||||||
}
|
}
|
||||||
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`)
|
core.info(`✒️ Wrote ${ignoredPrs.length} ignored pull requests down`)
|
||||||
|
|
||||||
|
// collect all contributors
|
||||||
|
let contributors: string[] = []
|
||||||
|
for (const pr of prs) {
|
||||||
|
contributors = contributors.concat(pr.author)
|
||||||
|
}
|
||||||
|
const contributorsString = contributors.join(', ')
|
||||||
|
core.setOutput('contributors', JSON.stringify(contributors))
|
||||||
|
|
||||||
// fill template
|
// fill template
|
||||||
const placeholderMap = new Map<string, string>()
|
const placeholderMap = new Map<string, string>()
|
||||||
placeholderMap.set('CHANGELOG', changelog)
|
placeholderMap.set('CHANGELOG', changelog)
|
||||||
placeholderMap.set('UNCATEGORIZED', changelogUncategorized)
|
placeholderMap.set('UNCATEGORIZED', changelogUncategorized)
|
||||||
placeholderMap.set('OPEN', changelogOpen)
|
placeholderMap.set('OPEN', changelogOpen)
|
||||||
placeholderMap.set('IGNORED', changelogIgnored)
|
placeholderMap.set('IGNORED', changelogIgnored)
|
||||||
|
// fill special collected contributors
|
||||||
|
placeholderMap.set('CONTRIBUTORS', contributorsString)
|
||||||
// fill other placeholders
|
// fill other placeholders
|
||||||
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString())
|
placeholderMap.set('CATEGORIZED_COUNT', categorizedPrs.length.toString())
|
||||||
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString())
|
placeholderMap.set('UNCATEGORIZED_COUNT', uncategorizedPrs.length.toString())
|
||||||
|
|||||||
Reference in New Issue
Block a user