Skip to content

Commit

Permalink
chore: update dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
release-please[bot] authored and github-actions[bot] committed Oct 10, 2024
1 parent 1363856 commit fe89030
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53064,9 +53064,13 @@ const pullRequestFiles = (
).data.map((file) => file.filename)

// Get the diff between the head branch and the base branch (limit to the files in the pull request)
const diff = await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.getExecOutput)('git', ['diff', '--unified=0', '--', ...pullRequestFiles], {
silent: true,
})
const diff = await (0,_actions_exec__WEBPACK_IMPORTED_MODULE_1__.getExecOutput)(
'git',
['diff', '--unified=0', '--', ...pullRequestFiles],
{
silent: true,
}
)

;(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.debug)(`Diff output: ${diff.stdout}`)

Expand All @@ -53075,7 +53079,7 @@ const parsedDiff = (0,parse_git_diff__WEBPACK_IMPORTED_MODULE_4__/* ["default"]

// Get changed files from parsedDiff (changed files have type 'ChangedFile')
const changedFiles = parsedDiff.files.filter(
(/** @type {{ type: string; }} */ file) => file.type === 'ChangedFile'
(file) => file.type === 'ChangedFile'
)

const generateSuggestionBody = (changes) => {
Expand Down Expand Up @@ -53115,11 +53119,11 @@ const comments = changedFiles.flatMap(({ path, chunks }) =>
(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.debug)(`Starting line: ${fromFileRange.start}`)
;(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.debug)(`Number of lines: ${fromFileRange.lines}`)
;(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.debug)(`Changes: ${JSON.stringify(changes)}`)
if (fromFileRange.start === fromFileRange.lines && changes.length === 2) {
return createSingleLineComment(path, fromFileRange, changes)
} else {
return createMultiLineComment(path, fromFileRange, changes)
}
const comment =
fromFileRange.lines <= 1
? createSingleLineComment(path, fromFileRange, changes)
: createMultiLineComment(path, fromFileRange, changes)
return comment
})
)

Expand Down

0 comments on commit fe89030

Please sign in to comment.