Skip to content

Commit

Permalink
fix: remove commit section on nodejs releases (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
Purexo authored Dec 5, 2023
1 parent 2718ec1 commit d3dc302
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/crons/NodeJsReleases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ export default new Cron({
await channel.send({
content: `# Release ${release.title}\n\n<${release.link}>`,
});

// remove the Commits section and after
const content = release.content
.replace(/\r?\n?\r?\n#{1,6}\s+Commits\r?\n.*$/, '')
.replaceAll('\r\n', '\n');

const content = release.content.replaceAll('\r\n', '\n');
const lines = content.split('\n');

let message = '';
Expand All @@ -42,6 +37,10 @@ export default new Cron({

message = '';
}

// remove the Commits section and after
if (line.match(/#{1,6}\s+Commits?/)) break;

message += '\n' + line;
}
if (message) {
Expand Down

0 comments on commit d3dc302

Please sign in to comment.