Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/autoupdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ export class AutoUpdater {
return false;
}

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line accesses pull.base.repo.full_name without checking if pull.base.repo is null or undefined. While the base repository should typically exist for all pull requests, the type system allows it to be null. Consider adding a null check similar to the one for pull.head.repo at line 262 to prevent potential runtime errors.

Suggested change
}
}
if (!pull.base.repo) {
ghCore.warning(
`Skipping pull request, base repository appears to be unavailable.`,
);
return false;
}

Copilot uses AI. Check for mistakes.

if (pull.head.repo.full_name !== pull.base.repo.full_name) {
ghCore.info('Pull request is from a fork, skipping...');
return false;
}

try {
Comment on lines +269 to 274

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new fork detection logic lacks test coverage. The test file (test/autoupdate.test.ts) contains extensive tests for the prNeedsUpdate function, but none that verify this new fork check behaves correctly. Consider adding test cases for: 1) a PR from a fork (where head.repo.full_name differs from base.repo.full_name) to verify it returns false and logs the appropriate message, and 2) a PR from the same repository to verify it continues with normal processing.

Copilot uses AI. Check for mistakes.
const { data: comparison } =
await this.octokit.rest.repos.compareCommitsWithBasehead({
Expand Down
Loading