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

separate config for max files to summarize and review #83

Merged
merged 5 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 7 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ inputs:
required: false
description: 'Enable debug mode'
default: 'false'
max_files:
max_files_to_summarize:
required: false
description:
'Max files to summarize. Less than or equal to 0 means no limit.'
default: '60'
max_files_to_review:
required: false
description: 'Max files to review. Less than or equal to 0 means no limit.'
default: '50'
default: '180'
review_comment_lgtm:
required: false
description: 'Leave comments even if the patch is LGTM'
Expand Down
103 changes: 71 additions & 32 deletions dist/index.js

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

3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {codeReview} from './review.js'
async function run(): Promise<void> {
const options: Options = new Options(
core.getBooleanInput('debug'),
core.getInput('max_files'),
core.getInput('max_files_to_summarize'),
core.getInput('max_files_to_review'),
core.getBooleanInput('review_comment_lgtm'),
core.getMultilineInput('path_filters'),
core.getInput('system_message'),
Expand Down
9 changes: 6 additions & 3 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ export class Inputs {

export class Options {
debug: boolean
max_files: number
max_files_to_summarize: number
max_files_to_review: number
review_comment_lgtm: boolean
path_filters: PathFilter
system_message: string
Expand All @@ -206,7 +207,8 @@ export class Options {

constructor(
debug: boolean,
max_files = '60',
max_files_to_summarize = '60',
max_files_to_review = '180',
review_comment_lgtm = false,
path_filters: string[] | null = null,
system_message = '',
Expand All @@ -217,7 +219,8 @@ export class Options {
openai_concurrency_limit = '4'
) {
this.debug = debug
this.max_files = parseInt(max_files)
this.max_files_to_summarize = parseInt(max_files_to_summarize)
this.max_files_to_review = parseInt(max_files_to_review)
this.review_comment_lgtm = review_comment_lgtm
this.path_filters = new PathFilter(path_filters)
this.system_message = system_message
Expand Down
Loading