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

Commit caa7a8f

Browse files
authored
allow disabling release notes (#253)
1 parent 92a379b commit caa7a8f

File tree

6 files changed

+40
-23
lines changed

6 files changed

+40
-23
lines changed

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ inputs:
5454
!**/_gen/**
5555
!**/generated/**
5656
!**/vendor/**
57-
summary_only:
57+
disable_review:
5858
required: false
5959
description: 'Only provide the summary and skip the code review.'
6060
default: 'false'
61+
disable_release_notes:
62+
required: false
63+
description: 'Disable release notes'
64+
default: 'false'
6165
openai_light_model:
6266
required: false
6367
description:

dist/index.js

Lines changed: 16 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {handleReviewComment} from './review-comment'
1414
async function run(): Promise<void> {
1515
const options: Options = new Options(
1616
getBooleanInput('debug'),
17-
getBooleanInput('summary_only'),
17+
getBooleanInput('disable_review'),
18+
getBooleanInput('disable_release_notes'),
1819
getInput('max_files'),
1920
getBooleanInput('review_simple_changes'),
2021
getBooleanInput('review_comment_lgtm'),

src/options.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {TokenLimits} from './limits'
44

55
export class Options {
66
debug: boolean
7-
summaryOnly: boolean
7+
disableReview: boolean
8+
disableReleaseNotes: boolean
89
maxFiles: number
910
reviewSimpleChanges: boolean
1011
reviewCommentLGTM: boolean
@@ -21,7 +22,8 @@ export class Options {
2122

2223
constructor(
2324
debug: boolean,
24-
summaryOnly: boolean,
25+
disableReview: boolean,
26+
disableReleaseNotes: boolean,
2527
maxFiles = '0',
2628
reviewSimpleChanges = false,
2729
reviewCommentLGTM = false,
@@ -35,7 +37,8 @@ export class Options {
3537
openaiConcurrencyLimit = '4'
3638
) {
3739
this.debug = debug
38-
this.summaryOnly = summaryOnly
40+
this.disableReview = disableReview
41+
this.disableReleaseNotes = disableReleaseNotes
3942
this.maxFiles = parseInt(maxFiles)
4043
this.reviewSimpleChanges = reviewSimpleChanges
4144
this.reviewCommentLGTM = reviewCommentLGTM
@@ -54,7 +57,8 @@ export class Options {
5457
// print all options using core.info
5558
print(): void {
5659
info(`debug: ${this.debug}`)
57-
info(`summary_only: ${this.summaryOnly}`)
60+
info(`disable_review: ${this.disableReview}`)
61+
info(`disable_release_notes: ${this.disableReleaseNotes}`)
5862
info(`max_files: ${this.maxFiles}`)
5963
info(`review_simple_changes: ${this.reviewSimpleChanges}`)
6064
info(`review_comment_lgtm: ${this.reviewCommentLGTM}`)

src/prompts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ Description:
6363
$description
6464
\`\`\`
6565
66-
OpenAI generated notes:
66+
OpenAI generated summary:
6767
\`\`\`
68-
$release_notes
68+
$raw_summary
6969
\`\`\`
7070
7171
Content of \`$filename\` prior to changes:
@@ -200,9 +200,9 @@ Description:
200200
$description
201201
\`\`\`
202202
203-
OpenAI generated notes:
203+
OpenAI generated summary:
204204
\`\`\`
205-
$release_notes
205+
$raw_summary
206206
\`\`\`
207207
208208
Content of file prior to changes:

src/review.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,11 @@ ${filename}: ${summary}
377377
if (summarizeFinalResponse === '') {
378378
info('summarize: nothing obtained from openai')
379379
} else {
380-
// final release notes
381380
nextSummarizeIds = summarizeFinalResponseIds
381+
}
382+
383+
if (options.disableReleaseNotes === false) {
384+
// final release notes
382385
const [releaseNotesResponse, releaseNotesIds] = await heavyBot.chat(
383386
prompts.renderSummarizeReleaseNotes(inputs),
384387
nextSummarizeIds
@@ -470,7 +473,7 @@ ${
470473
}
471474
`
472475

473-
if (!options.summaryOnly) {
476+
if (!options.disableReview) {
474477
const filesAndChangesReview = filesAndChanges.filter(([filename]) => {
475478
const needsReview =
476479
summaries.find(

0 commit comments

Comments
 (0)