Skip to content

Commit 40a4ee2

Browse files
committed
#55 - Chapter line formatting - authors
- Add limitation to avoid of usage black to tests. - Removed workflow copying Release notes from PR to Issue as no more supported. - Updated README.md to show example of row formatting as build-in feature and provide list of supported keywords.
1 parent 178819b commit 40a4ee2

File tree

7 files changed

+22
-118
lines changed

7 files changed

+22
-118
lines changed

.github/workflows/release_notes_comments_migration.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Generate Release Notes action is dedicated to enhance the quality and organizati
5454
### `row-format-issue`
5555
- **Description**: The format of the row for the issue in the release notes. The format can contain placeholders for the issue `number`, `title`, and issues `pull-requests`. The placeholders are case-sensitive.
5656
- **Required**: No
57-
- **Default**: `#{number} _{title}_ in {pull-requests}"`
57+
- **Default**: `#{number} _{title}_ {pull-requests}"`
5858

5959
### `row-format-pr`
6060
- **Description**: The format of the row for the PR in the release notes. The format can contain placeholders for the PR `number`, `title`, and PR `pull-requests`. The placeholders are case-sensitive.
@@ -166,6 +166,9 @@ Add the following step to your GitHub workflow (in example are used non-default
166166
warnings: false
167167
print-empty-chapters: false
168168
chapters-to-pr-without-issue: false
169+
row-format-issue: '#{number} _{title}_ {pull-requests}"'
170+
row-format-pr: '#{number} _{title}_"'
171+
row-format-link-pr: true
169172
```
170173
171174
## Features
@@ -197,6 +200,16 @@ If an issue is linked to multiple PRs, the action fetches and aggregates contrib
197200
#### No Release Notes Found
198201
If no valid "Release Notes" comment is found in an issue, it will be marked accordingly. This helps maintainers quickly identify which issues need attention for documentation.
199202

203+
#### Row formatting
204+
Format of the row for the issue and PR in the release notes can be customized. The placeholders are case-sensitive.
205+
206+
**Supported row format keywords:**
207+
- `{number}`: Issue or PR number.
208+
- `{title}`: Issue or PR title.
209+
- `{pull-requests}`: List of PRs linked to the issue. Adds a list of PRs linked to the issue in the row with `in` prefix:
210+
- `#{number} _{title}_ {pull-requests}` => "[#43]() _title_ in [#PR1](), [#PR2](), [#PR3]()"
211+
- Not used in PR row format. See default value.
212+
200213
### Select start date for closed issues and PRs
201214
By set **published-at** to true the action will use the `published-at` timestamp of the latest release as the reference point for searching closed issues and PRs, instead of the `created-at` date. If first release, repository creation date is used.
202215

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ inputs:
5858
row-format-issue:
5959
description: 'Format of the issue row in the release notes. Available placeholders: {link}, {title}, {pull-requests}. Placeholders are case-insensitive.'
6060
required: false
61-
default: '#{number} _{title}_ in {pull-requests}'
61+
default: '#{number} _{title}_ {pull-requests} {authors}'
6262
row-format-pr:
6363
description: 'Format of the pr row in the release notes. Available placeholders: {link}, {title}, {pull-requests}. Placeholders are case-insensitive.'
6464
required: false
65-
default: '#{number} _{title}_'
65+
default: '#{number} _{title}_ {authors}'
6666
row-format-link-pr:
6767
description: 'Add prefix "PR:" before link to PR when not linked an Issue.'
6868
required: false

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[tool.black]
22
line-length = 120
33
target-version = ['py311']
4+
force-exclude = '''test'''

release_notes_generator/action_inputs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def get_row_format_issue() -> str:
167167
"""
168168
Get the issue row format for the release notes.
169169
"""
170-
return get_action_input(ROW_FORMAT_ISSUE, "#{number} _{title}_ in {pull-requests}").strip()
170+
return get_action_input(ROW_FORMAT_ISSUE, "#{number} _{title}_ {pull-requests}").strip()
171171

172172
@staticmethod
173173
def get_row_format_pr() -> str:

release_notes_generator/model/record.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def to_chapter_row(self) -> str:
287287
else:
288288
format_values["number"] = self.__gh_issue.number
289289
format_values["title"] = self.__gh_issue.title
290-
format_values["pull-requests"] = self.pr_links if len(self.__pulls) > 0 else ""
290+
format_values["pull-requests"] = f"in {self.pr_links}" if len(self.__pulls) > 0 else ""
291291
format_values["authors"] = self.authors if self.authors is not None else ""
292292
format_values["contributors"] = self.contributors if self.contributors is not None else ""
293293

tests/release_notes/test_release_notes_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ def __init__(self, name):
173173
"""
174174

175175
RELEASE_NOTES_DATA_SERVICE_CHAPTERS_CLOSED_ISSUE_NO_PR_NO_USER_LABELS = """### Closed Issues without Pull Request ⚠️
176-
- #121 _Fix the bug_ in
176+
- #121 _Fix the bug_
177177
178178
### Closed Issues without User Defined Labels ⚠️
179-
- 🔔 #121 _Fix the bug_ in
179+
- 🔔 #121 _Fix the bug_
180180
181181
#### Full Changelog
182182
http://example.com/changelog
@@ -224,7 +224,7 @@ def __init__(self, name):
224224
"""
225225

226226
RELEASE_NOTES_DATA_CLOSED_ISSUE_NO_PR_WITH_USER_LABELS = """### Closed Issues without Pull Request ⚠️
227-
- #121 _Fix the bug_ in
227+
- #121 _Fix the bug_
228228
229229
#### Full Changelog
230230
http://example.com/changelog

0 commit comments

Comments
 (0)