Skip to content

Commit

Permalink
Merge branch 'master' into update-node
Browse files Browse the repository at this point in the history
  • Loading branch information
rajbos committed Dec 12, 2023
2 parents ac300f5 + fd80e69 commit 84c8b74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14565,7 +14565,7 @@ async function run() {
const labelName = core.getInput('labelName');
const labelColor = core.getInput('labelColor');
await getOrCreateLfsWarningLabel(labelName, labelColor);
if (event_type === 'pull_request') {
if (event_type === 'pull_request' || event_type === 'pull_request_target') {
const pullRequestNumber = (_a = context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.number;
if (pullRequestNumber === undefined) {
throw new Error('Could not get PR number');
Expand Down Expand Up @@ -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({
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function run() {

await getOrCreateLfsWarningLabel(labelName, labelColor);

if (event_type === 'pull_request') {
if (event_type === 'pull_request' || event_type === 'pull_request_target') {
const pullRequestNumber = context.payload.pull_request?.number;

if (pullRequestNumber === undefined) {
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 84c8b74

Please sign in to comment.