Skip to content

Commit

Permalink
Update git branch type and nullable handler
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed Oct 25, 2023
1 parent d46cda2 commit 9a170d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static_report/src/components/Reports/ReportContextBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ReportContextBar({
}: Props) {
let datasource: string | undefined = undefined;
let version: string | undefined = undefined;
let gitBranch: string | undefined = undefined;
let gitBranch: string | null | undefined = undefined;
let githubPr: string | undefined = undefined;
let githubPrUrl: string | undefined = undefined;
let baseFrom: string | undefined = undefined;
Expand Down Expand Up @@ -58,6 +58,8 @@ export function ReportContextBar({
report.input?.datasource.git_branch
) {
gitBranch = `${report.base?.datasource.git_branch}${report.input?.datasource.git_branch}`;
} else if (report.input?.datasource.git_branch) {
gitBranch = report.input?.datasource.git_branch;
}

if (report.metadata?.github_pr_id && report.metadata?.github_pr_url) {
Expand Down

0 comments on commit 9a170d9

Please sign in to comment.