Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add optional to type chain #560

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 14 additions & 1 deletion src/utils/__tests__/changelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('generateChangesetFromGit', () => {
pr?: {
local?: string;
remote?: {
author: { login: string };
author?: { login: string };
number: string;
body?: string;
milestone?: string;
Expand Down Expand Up @@ -389,6 +389,19 @@ describe('generateChangesetFromGit', () => {
{},
'### Various fixes & improvements\n\n- Upgraded the kernel (#123) by @sentry',
],
[
'Does not error when PR author is null',
[
{
hash: 'abcdef1234567890',
title: 'Upgraded the kernel',
body: '',
pr: { remote: { number: '123' } },
},
],
{},
'### Various fixes & improvements\n\n- Upgraded the kernel (#123)',
],
[
'handle multiple commits properly',
[
Expand Down
4 changes: 2 additions & 2 deletions src/utils/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ interface CommitInfo {
nodes: Array<{
number: string;
body: string;
author: {
author?: {
login: string;
};
milestone: {
Expand Down Expand Up @@ -472,7 +472,7 @@ async function getPRAndMilestoneFromCommit(
hash.slice(1),
pr
? {
author: pr.author.login,
author: pr.author?.login,
pr: pr.number,
prBody: pr.body,
milestone: pr.milestone?.number ?? null,
Expand Down
Loading