From 573e16fa3bdd69827b8686865af90e8206dbe49e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Tue, 27 Aug 2024 18:32:01 +0200 Subject: [PATCH] CI: Null check for author (#92516) Null check for author --- .github/workflows/actions/changelog/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/changelog/index.js b/.github/workflows/actions/changelog/index.js index 9bb200ba208..48da9dcf33a 100644 --- a/.github/workflows/actions/changelog/index.js +++ b/.github/workflows/actions/changelog/index.js @@ -199,7 +199,7 @@ const getChangeLogItems = async (name, owner, sinceDate, to) => { hasLabel({ labels }, 'area/grafana/ui') || hasLabel({ labels }, 'area/grafana/toolkit') || hasLabel({ labels }, 'area/grafana/runtime'); - const author = item.commits.nodes[0].commit.author.user.login; + const author = item.commits.nodes[0].commit.author.user?.login; return { repo: name, number, @@ -285,7 +285,7 @@ ${items `- ${item.title.replace(/^([^:]*:)/gm, '**$1**')} ${ item.repo === 'grafana-enterprise' ? '(Enterprise)' - : `${pullRequestLink(item.number)}, ${userLink(item.author)}` + : `${pullRequestLink(item.number)}${item.author ? ', ' + userLink(item.author) : ''}` }` ) .join('\n')}