Skip to content

Commit 52b9cc9

Browse files
committed
refactor: extract hardcode document links into config
Signed-off-by: Parv Ninama <ninamaparv@gmail.com>
1 parent 1cd5b54 commit 52b9cc9

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/scripts/shared/config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ const CONFIG = {
2828
owner: 'hiero-ledger',
2929
repo: 'hiero-sdk-python',
3030
isHome: true,
31+
repositoryUrl: 'https://github.com/hiero-ledger/hiero-sdk-python',
32+
communityLinks: {
33+
discord: 'https://discord.com/invite/hyperledger',
34+
},
35+
botSignature: 'Hiero Python SDK Team',
3136
labels: {
3237
gfi: GOOD_FIRST_ISSUE_LABEL,
3338
beginner: BEGINNER_LABEL,
@@ -47,7 +52,6 @@ const CONFIG = {
4752
},
4853
],
4954

50-
repositoryUrl: 'https://github.com/hiero-ledger/hiero-sdk-python',
5155
maxRecommendations: 5,
5256
fetchPerPage: 50,
5357
commentMarker: '<!-- hiero-next-issue-bot -->',

.github/scripts/shared/helpers/comment.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,16 @@ function buildMilestoneBlock(unlockedLevelKey) {
5353
* @returns {string} Fully rendered comment body.
5454
*/
5555
function buildRecommendationComment(username, issues, completedDisplayName, unlockedLevelKey = null) {
56-
const repoUrl = CONFIG.repositoryUrl ?? '';
56+
const homeRepo = CONFIG.repos.find(r => r.isHome) || {};
57+
58+
const {
59+
repositoryUrl: repoUrl = '',
60+
communityLinks = {},
61+
botSignature = 'Hiero Team',
62+
} = homeRepo;
63+
5764
const hasRepoUrl = Boolean(repoUrl);
65+
5866
return [
5967
CONFIG.commentMarker,
6068
'',
@@ -68,11 +76,14 @@ function buildRecommendationComment(username, issues, completedDisplayName, unlo
6876
'🌟 **Stay connected:**',
6977
`- ⭐ [Star this repository](${repoUrl})`,
7078
`- 👀 [Watch for new issues](${repoUrl}/watchers)`,
71-
`- 💬 [Join us on Discord](${repoUrl}/blob/main/docs/discord.md)`,
72-
]:[]),
79+
...(communityLinks?.discord
80+
? [`- 💬 [Join us on Discord](${communityLinks.discord})`]
81+
: []),
82+
] : []),
83+
7384
'',
74-
'Happy coding! 🚀',
75-
'_— Hiero Python SDK Team_',
85+
'Happy coding! 🚀',
86+
`_— ${botSignature}_`,
7687
].join('\n');
7788
}
7889

0 commit comments

Comments
 (0)