Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

fix issue with multiple release notes #452

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 18 additions & 56 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const IN_PROGRESS_START_TAG =
export const IN_PROGRESS_END_TAG =
'<!-- end of auto-generated comment: summarize review in progress by OSS CodeRabbit -->'

export const DESCRIPTION_START_TAG = `
<!-- This is an auto-generated comment: release notes by OSS CodeRabbit -->`
export const DESCRIPTION_START_TAG =
'<!-- This is an auto-generated comment: release notes by OSS CodeRabbit -->'
export const DESCRIPTION_END_TAG =
'<!-- end of auto-generated comment: release notes by OSS CodeRabbit -->'

Expand Down Expand Up @@ -93,7 +93,7 @@ ${tag}`

removeContentWithinTags(content: string, startTag: string, endTag: string) {
const start = content.indexOf(startTag)
const end = content.indexOf(endTag)
const end = content.lastIndexOf(endTag)
if (start >= 0 && end >= 0) {
return content.slice(0, start) + content.slice(end + endTag.length)
}
Expand Down Expand Up @@ -155,7 +155,7 @@ ${tag}`
DESCRIPTION_START_TAG,
DESCRIPTION_END_TAG
)
const newDescription = `${description}${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
const newDescription = `${description}\n${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
await octokit.pulls.update({
owner: repo.owner,
repo: repo.repo,
Expand Down