Skip to content

Commit

Permalink
fix: missed null checks (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitcommitshow authored Sep 27, 2024
1 parent 394c969 commit 2739f74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ export async function afterCLA(app, claSignatureInfo) {
order: "desc"
});

const filteredPrs = prs?.filter(pr => pr.user.login === githubUsername);
console.log(`Found ${filteredPrs?.length} open PRs for ${githubUsername} in ${org}:`, filteredPrs?.map(pr => pr.number).join(', '));
const filteredPrs = prs?.filter(pr => pr?.user?.login === githubUsername);
console.log(`Found ${filteredPrs?.length} open PRs for ${githubUsername} in ${org}:`, filteredPrs?.map(pr => pr?.number).join(', '));
let failuresToRemoveLabel = 0;
for (const pr of filteredPrs) {
const { owner, repo } = parseRepoUrl(pr?.repository_url) || {};
const hasPendingCLALabel = pr.labels?.some(label => label?.name?.toLowerCase() === "pending cla");
console.log(`PR #${pr.number} has "Pending CLA" label: ${hasPendingCLALabel}`);
console.log(`PR #${pr?.number} has "Pending CLA" label: ${hasPendingCLALabel}`);
if (hasPendingCLALabel) {
try {
await removePendingCLALabel(octokit, owner, repo, pr?.number);
Expand Down

0 comments on commit 2739f74

Please sign in to comment.