Skip to content

Commit

Permalink
use defaults for max_buffer_size as a backup
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Sep 13, 2023
1 parent b24959b commit e0db582
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/functions/git-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ export function gitDiff() {
core.debug(`base_branch: ${baseBranch}`)
const searchPath = core.getInput('search_path')
core.debug(`search_path: ${searchPath}`)
const maxBufferSize = parseInt(core.getInput('max_buffer_size'))
const maxBufferSizeInput = parseInt(core.getInput('max_buffer_size'))
core.debug(`max_buffer_size: ${maxBufferSize}`)
const fileOutputOnly = core.getInput('file_output_only') === 'true'

// if max_buffer_size is not defined, just use the default
var maxBufferSize = maxBufferSizeInput
if (
isNaN(maxBufferSizeInput) ||
maxBufferSizeInput === null ||
maxBufferSizeInput === undefined
) {
core.info('max_buffer_size is not defined, using default of 1000000')
maxBufferSize = 1000000
}

exec(
`git diff ${baseBranch} ${searchPath}`,
{maxBuffer: maxBufferSize},
Expand Down

0 comments on commit e0db582

Please sign in to comment.