diff --git a/.changeset/two-cameras-repeat.md b/.changeset/two-cameras-repeat.md new file mode 100644 index 0000000000..467f33adc4 --- /dev/null +++ b/.changeset/two-cameras-repeat.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-github-deployments': patch +--- + +Handle deployments without a commit diff --git a/plugins/github-deployments/src/api/index.ts b/plugins/github-deployments/src/api/index.ts index d7e7e2fca6..a5d824914e 100644 --- a/plugins/github-deployments/src/api/index.ts +++ b/plugins/github-deployments/src/api/index.ts @@ -60,7 +60,7 @@ export type GithubDeployment = { commit: { abbreviatedOid: string; commitUrl: string; - }; + } | null; creator: { login: string; }; diff --git a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx index f050af836c..a4aad47657 100644 --- a/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx +++ b/plugins/github-deployments/src/components/GithubDeploymentsTable/columns.tsx @@ -66,11 +66,12 @@ export function createStatusColumn(): TableColumn { export function createCommitColumn(): TableColumn { return { title: 'Commit', - render: (row: GithubDeployment): JSX.Element => ( - - {row.commit.abbreviatedOid} - - ), + render: (row: GithubDeployment) => + row.commit && ( + + {row.commit.abbreviatedOid} + + ), }; }