Skip to content

Commit

Permalink
bug: diff exit code 0 shouldn't fail to return files
Browse files Browse the repository at this point in the history
  • Loading branch information
cwbusacker committed Mar 19, 2024
1 parent 8ef4015 commit b45007a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/github/get-diff-from-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ export const getFileDiffFromGithub = async ({
}
)

if (!diff.exitCode || !base.exitCode || !head.exitCode) {
if (diff.exitCode || base.exitCode || head.exitCode) {
const errors: string[] = []

if(!diff.exitCode){
if(diff.exitCode){
errors.push( `Failed to get diff files between ${base}..${head} Exit code: ${diff.exitCode}. Due to error ${diff.stderr}`)
}

if(!base.exitCode){
if(base.exitCode){
errors.push( `Failed to fetch base: ${base} commit Exit code: ${base.exitCode}. Due to error ${base.stderr}`)
}

if(!head.exitCode){
if(head.exitCode){
errors.push( `Failed to fetch head: ${head} commit Exit code: ${head.exitCode}. Due to error ${head.stderr}`)
}

Expand Down

0 comments on commit b45007a

Please sign in to comment.