CI: Null check for author (#92516)

Null check for author
haris/query-library/enhance-user-data
Piotr Jamróz 9 months ago committed by GitHub
parent de2c9a06bf
commit 573e16fa3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      .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')}

Loading…
Cancel
Save