Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 62354fc

Browse files
fix(release notes): use 40px user avatar (#120)
1 parent 29965b0 commit 62354fc

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

action/main.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
from dotenv import load_dotenv
1010
import requests
1111

12+
# global variables
13+
AVATAR_SIZE = 40
14+
1215
# Load the environment variables from the Environment File
1316
load_dotenv()
1417

@@ -306,21 +309,20 @@ def process_release_body(release_body: str) -> str:
306309
# sort contributors by contributions count
307310
contributors = dict(sorted(contributors.items(), key=lambda item: (-item[1]['contributions'], item[0])))
308311

309-
processed_body += '\n---\n'
312+
processed_body += '\n\n---\n'
310313
processed_body += '## Contributors\n'
311314
for contributor, details in contributors.items():
312315
# add the contributor's avatar
313-
# use <img> tag to ensure the image is the correct size of 50x50
314-
# unchanged avatars cannot use the size query
316+
# use <img> tag to ensure the image is the correct size as unchanged avatars cannot use the size query
315317
processed_body += (
316318
f'<a href="{details["url"]}" '
317319
'target="_blank" '
318320
'rel="external noopener noreferrer" '
319321
f'aria-label="GitHub profile of contributor, {contributor}" '
320322
'>'
321-
f'<img src="{details["url"]}.png?size=50" '
322-
'width="50" '
323-
'height="50" '
323+
f'<img src="{details["url"]}.png?size={AVATAR_SIZE}" '
324+
f'width="{AVATAR_SIZE}" '
325+
f'height="{AVATAR_SIZE}" '
324326
f'alt="{contributor}" '
325327
f'title="{contributor}: {details["contributions"]} '
326328
f'{"merges" if details["contributions"] > 1 else "merge"}" '

tests/data/expected_release_notes_sample_0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149

150150
**Full Changelog**: https://github.com/LizardByte/Sunshine/compare/v0.23.1...2024.713.195308
151151

152+
152153
---
153154
## Contributors
154-
<a href="https://github.com/ReenigneArcher" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ReenigneArcher" ><img src="https://github.com/ReenigneArcher.png?size=50" width="50" height="50" alt="ReenigneArcher" title="ReenigneArcher: 59 merges" ></a><a href="https://github.com/dependabot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, dependabot" ><img src="https://github.com/dependabot.png?size=50" width="50" height="50" alt="dependabot" title="dependabot: 41 merges" ></a><a href="https://github.com/Hazer" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, Hazer" ><img src="https://github.com/Hazer.png?size=50" width="50" height="50" alt="Hazer" title="Hazer: 6 merges" ></a><a href="https://github.com/LizardByte-bot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, LizardByte-bot" ><img src="https://github.com/LizardByte-bot.png?size=50" width="50" height="50" alt="LizardByte-bot" title="LizardByte-bot: 5 merges" ></a><a href="https://github.com/gschintgen" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, gschintgen" ><img src="https://github.com/gschintgen.png?size=50" width="50" height="50" alt="gschintgen" title="gschintgen: 4 merges" ></a><a href="https://github.com/TimmyOVO" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, TimmyOVO" ><img src="https://github.com/TimmyOVO.png?size=50" width="50" height="50" alt="TimmyOVO" title="TimmyOVO: 3 merges" ></a><a href="https://github.com/tez011" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, tez011" ><img src="https://github.com/tez011.png?size=50" width="50" height="50" alt="tez011" title="tez011: 3 merges" ></a><a href="https://github.com/BeeLeDev" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, BeeLeDev" ><img src="https://github.com/BeeLeDev.png?size=50" width="50" height="50" alt="BeeLeDev" title="BeeLeDev: 2 merges" ></a><a href="https://github.com/c3m3gyanesh" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, c3m3gyanesh" ><img src="https://github.com/c3m3gyanesh.png?size=50" width="50" height="50" alt="c3m3gyanesh" title="c3m3gyanesh: 2 merges" ></a><a href="https://github.com/cathyjf" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cathyjf" ><img src="https://github.com/cathyjf.png?size=50" width="50" height="50" alt="cathyjf" title="cathyjf: 2 merges" ></a><a href="https://github.com/cfalas" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cfalas" ><img src="https://github.com/cfalas.png?size=50" width="50" height="50" alt="cfalas" title="cfalas: 2 merges" ></a><a href="https://github.com/cgarst" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cgarst" ><img src="https://github.com/cgarst.png?size=50" width="50" height="50" alt="cgarst" title="cgarst: 2 merges" ></a><a href="https://github.com/cgutman" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cgutman" ><img src="https://github.com/cgutman.png?size=50" width="50" height="50" alt="cgutman" title="cgutman: 2 merges" ></a><a href="https://github.com/chewi" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, chewi" ><img src="https://github.com/chewi.png?size=50" width="50" height="50" alt="chewi" title="chewi: 2 merges" ></a><a href="https://github.com/hgaiser" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, hgaiser" ><img src="https://github.com/hgaiser.png?size=50" width="50" height="50" alt="hgaiser" title="hgaiser: 2 merges" ></a><a href="https://github.com/ns6089" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ns6089" ><img src="https://github.com/ns6089.png?size=50" width="50" height="50" alt="ns6089" title="ns6089: 2 merges" ></a><a href="https://github.com/skryvel" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, skryvel" ><img src="https://github.com/skryvel.png?size=50" width="50" height="50" alt="skryvel" title="skryvel: 2 merges" ></a><a href="https://github.com/xanderfrangos" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, xanderfrangos" ><img src="https://github.com/xanderfrangos.png?size=50" width="50" height="50" alt="xanderfrangos" title="xanderfrangos: 2 merges" ></a><a href="https://github.com/ABeltramo" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ABeltramo" ><img src="https://github.com/ABeltramo.png?size=50" width="50" height="50" alt="ABeltramo" title="ABeltramo: 1 merge" ></a><a href="https://github.com/mariotaku" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, mariotaku" ><img src="https://github.com/mariotaku.png?size=50" width="50" height="50" alt="mariotaku" title="mariotaku: 1 merge" ></a>
155+
<a href="https://github.com/ReenigneArcher" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ReenigneArcher" ><img src="https://github.com/ReenigneArcher.png?size=40" width="40" height="40" alt="ReenigneArcher" title="ReenigneArcher: 59 merges" ></a><a href="https://github.com/dependabot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, dependabot" ><img src="https://github.com/dependabot.png?size=40" width="40" height="40" alt="dependabot" title="dependabot: 41 merges" ></a><a href="https://github.com/Hazer" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, Hazer" ><img src="https://github.com/Hazer.png?size=40" width="40" height="40" alt="Hazer" title="Hazer: 6 merges" ></a><a href="https://github.com/LizardByte-bot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, LizardByte-bot" ><img src="https://github.com/LizardByte-bot.png?size=40" width="40" height="40" alt="LizardByte-bot" title="LizardByte-bot: 5 merges" ></a><a href="https://github.com/gschintgen" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, gschintgen" ><img src="https://github.com/gschintgen.png?size=40" width="40" height="40" alt="gschintgen" title="gschintgen: 4 merges" ></a><a href="https://github.com/TimmyOVO" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, TimmyOVO" ><img src="https://github.com/TimmyOVO.png?size=40" width="40" height="40" alt="TimmyOVO" title="TimmyOVO: 3 merges" ></a><a href="https://github.com/tez011" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, tez011" ><img src="https://github.com/tez011.png?size=40" width="40" height="40" alt="tez011" title="tez011: 3 merges" ></a><a href="https://github.com/BeeLeDev" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, BeeLeDev" ><img src="https://github.com/BeeLeDev.png?size=40" width="40" height="40" alt="BeeLeDev" title="BeeLeDev: 2 merges" ></a><a href="https://github.com/c3m3gyanesh" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, c3m3gyanesh" ><img src="https://github.com/c3m3gyanesh.png?size=40" width="40" height="40" alt="c3m3gyanesh" title="c3m3gyanesh: 2 merges" ></a><a href="https://github.com/cathyjf" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cathyjf" ><img src="https://github.com/cathyjf.png?size=40" width="40" height="40" alt="cathyjf" title="cathyjf: 2 merges" ></a><a href="https://github.com/cfalas" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cfalas" ><img src="https://github.com/cfalas.png?size=40" width="40" height="40" alt="cfalas" title="cfalas: 2 merges" ></a><a href="https://github.com/cgarst" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cgarst" ><img src="https://github.com/cgarst.png?size=40" width="40" height="40" alt="cgarst" title="cgarst: 2 merges" ></a><a href="https://github.com/cgutman" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, cgutman" ><img src="https://github.com/cgutman.png?size=40" width="40" height="40" alt="cgutman" title="cgutman: 2 merges" ></a><a href="https://github.com/chewi" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, chewi" ><img src="https://github.com/chewi.png?size=40" width="40" height="40" alt="chewi" title="chewi: 2 merges" ></a><a href="https://github.com/hgaiser" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, hgaiser" ><img src="https://github.com/hgaiser.png?size=40" width="40" height="40" alt="hgaiser" title="hgaiser: 2 merges" ></a><a href="https://github.com/ns6089" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ns6089" ><img src="https://github.com/ns6089.png?size=40" width="40" height="40" alt="ns6089" title="ns6089: 2 merges" ></a><a href="https://github.com/skryvel" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, skryvel" ><img src="https://github.com/skryvel.png?size=40" width="40" height="40" alt="skryvel" title="skryvel: 2 merges" ></a><a href="https://github.com/xanderfrangos" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, xanderfrangos" ><img src="https://github.com/xanderfrangos.png?size=40" width="40" height="40" alt="xanderfrangos" title="xanderfrangos: 2 merges" ></a><a href="https://github.com/ABeltramo" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, ABeltramo" ><img src="https://github.com/ABeltramo.png?size=40" width="40" height="40" alt="ABeltramo" title="ABeltramo: 1 merge" ></a><a href="https://github.com/mariotaku" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, mariotaku" ><img src="https://github.com/mariotaku.png?size=40" width="40" height="40" alt="mariotaku" title="mariotaku: 1 merge" ></a>

tests/data/expected_release_notes_sample_1.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## New Contributors
66
* [@LizardByte](https://github.com/LizardByte) made their first contribution
77

8+
89
---
910
## Contributors
10-
<a href="https://github.com/LizardByte" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, LizardByte" ><img src="https://github.com/LizardByte.png?size=50" width="50" height="50" alt="LizardByte" title="LizardByte: 2 merges" ></a><a href="https://github.com/dependabot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, dependabot" ><img src="https://github.com/dependabot.png?size=50" width="50" height="50" alt="dependabot" title="dependabot: 1 merge" ></a>
11+
<a href="https://github.com/LizardByte" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, LizardByte" ><img src="https://github.com/LizardByte.png?size=40" width="40" height="40" alt="LizardByte" title="LizardByte: 2 merges" ></a><a href="https://github.com/dependabot" target="_blank" rel="external noopener noreferrer" aria-label="GitHub profile of contributor, dependabot" ><img src="https://github.com/dependabot.png?size=40" width="40" height="40" alt="dependabot" title="dependabot: 1 merge" ></a>

0 commit comments

Comments
 (0)