Skip to content

Commit

Permalink
fix(changelog): resolve issue when @ symbol appears earlier in entr…
Browse files Browse the repository at this point in the history
…y than the contributor (#112)
  • Loading branch information
ReenigneArcher authored Jul 16, 2024
1 parent a5aef49 commit fd48baa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion action/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,10 @@ def process_release_body(release_body: str) -> str:
re_username = re.compile(r'@([a-zA-Z\d\-]{0,38})')
re_pr_url = re.compile(r'(https://github\.com/([a-zA-Z\d\-]{0,38})/([a-zA-Z\d-]+)/pull/(\d+))')
for line in io.StringIO(release_body).readlines():
split_line = line.rsplit(' by ', 1)

# find the username
username_search = re_username.search(line)
username_search = re_username.search(split_line[1] if len(split_line) > 1 else line)
if not username_search:
processed_body += line
continue
Expand Down
1 change: 1 addition & 0 deletions tests/data/expected_release_notes_sample_1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## What's Changed
* test: Test coverage by not providing a PR URL by [@LizardByte](https://github.com/LizardByte)
* build(deps): bump @fortawesome/fontawesome-free from 6.5.1 to 6.5.2 by [@dependabot](https://github.com/dependabot) in [#412](https://github.com/LizardByte/Themerr-plex/pull/412)

## New Contributors
* [@LizardByte](https://github.com/LizardByte) made their first contribution
1 change: 1 addition & 0 deletions tests/data/provided_release_notes_sample_1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## What's Changed
* test: Test coverage by not providing a PR URL by @LizardByte
* build(deps): bump @fortawesome/fontawesome-free from 6.5.1 to 6.5.2 by @dependabot in https://github.com/LizardByte/Themerr-plex/pull/412

## New Contributors
* @LizardByte made their first contribution

0 comments on commit fd48baa

Please sign in to comment.