Skip to content

Commit

Permalink
refactor: make commit message bold (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
boywithkeyboard authored Sep 10, 2023
1 parent 099bb06 commit 096e368
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions action.js
Original file line number Diff line number Diff line change
Expand Up @@ -21034,7 +21034,7 @@ async function action() {
return commit
}
const i = c.data.commit.message.indexOf(')\n\n')
const title = c.data.commit.message.substring(0, i > 0 ? i + 1 : void 0)
let title = c.data.commit.message.substring(0, i > 0 ? i + 1 : void 0)
const comments = (await rest.issues.listComments({
...import_github.context.repo,
issue_number: number,
Expand All @@ -21050,8 +21050,10 @@ async function action() {
) {
continue
}
title = linkifyReferences(title)
title = title.replace(': ', ': **').replace(' ([#', '** ([#')
releaseBody += `
* ${linkifyReferences(title)}`
* ${title}`
if (config.includeAuthor && user?.login) {
contributors.add(`, @${user.login}`)
releaseBody += ` by @${user.login}`
Expand All @@ -21071,7 +21073,7 @@ ${indentString(body, 2)}
: arr[arr.length - 1].replace(', ', ' & ')
releaseBody += `

###### Contributed by ${arr.join('')}`
Contributed by ${arr.join('')}`
}
const { data: release } = await rest.repos.createRelease({
owner: import_github.context.repo.owner,
Expand Down
9 changes: 6 additions & 3 deletions action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ async function action() {
}

const i = c.data.commit.message.indexOf(')\n\n')
const title = c.data.commit.message.substring(0, i > 0 ? i + 1 : undefined)
let title = c.data.commit.message.substring(0, i > 0 ? i + 1 : undefined)

const comments = (await rest.issues.listComments({
...context.repo,
Expand All @@ -230,9 +230,12 @@ async function action() {
continue
}

title = linkifyReferences(title)
title = title.replace(': ', ': **').replace(' ([#', '** ([#')

// changelogBody += `\n* ${linkifyReferences(title)}`

releaseBody += `\n* ${linkifyReferences(title)}`
releaseBody += `\n* ${title}`

if (config.includeAuthor && user?.login) {
// changelogBody += user?.login
Expand All @@ -257,7 +260,7 @@ async function action() {
? arr[arr.length - 1].replace(', ', ', & ')
: arr[arr.length - 1].replace(', ', ' & ')

releaseBody += `\n\n###### Contributed by ${arr.join('')}`
releaseBody += `\n\nContributed by ${arr.join('')}`
}

const { data: release } = await rest.repos.createRelease({
Expand Down

0 comments on commit 096e368

Please sign in to comment.