From e2259770e4c823bd1cb5901f19f5fd2a08a3e93f Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Sun, 10 Dec 2023 15:48:44 +0100 Subject: [PATCH 1/2] Exclude files without blob_url when getting PR blobs --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index a3bad0e..9894510 100644 --- a/src/index.ts +++ b/src/index.ts @@ -199,8 +199,8 @@ async function getPrFilesWithBlobSize(pullRequestNumber: number) { const prFilesWithBlobSize = await Promise.all( files - // Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) - .filter(file => file.sha != null) + // Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) or without blob_url (e.g. submodules) + .filter(file => file.sha != null && file.blob_url != null) .map(async file => { const {filename, sha, patch} = file; const {data: blob} = await octokit.rest.git.getBlob({ From d8be037e8a52db1c14b2fe9eb5797032f1744b9a Mon Sep 17 00:00:00 2001 From: Rob Bos Date: Sun, 10 Dec 2023 14:52:41 +0000 Subject: [PATCH 2/2] Update release code --- dist/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 4c5ab3f..8f428b8 100644 --- a/dist/index.js +++ b/dist/index.js @@ -14701,8 +14701,8 @@ async function getPrFilesWithBlobSize(pullRequestNumber) { }) : data; const prFilesWithBlobSize = await Promise.all(files - // Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) - .filter(file => file.sha != null) + // Cannot get blobs for files without sha (e.g. happens when only changing a permission bit on the file) or without blob_url (e.g. submodules) + .filter(file => file.sha != null && file.blob_url != null) .map(async (file) => { const { filename, sha, patch } = file; const { data: blob } = await octokit.rest.git.getBlob({