Skip to content

Commit

Permalink
feat(platform/gitlab)!: prefer commit_email (#21122)
Browse files Browse the repository at this point in the history
gitAuthor discover for GitLab now prefers the field `commit_email` over `email`.

Closes #12532

BREAKING CHANGE: GitLab gitAuthor will change from the account's "email" to "commit_email" if they are different.
  • Loading branch information
viceice authored and rarkins committed Jul 4, 2023
1 parent 61a7813 commit 08bbf81
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/modules/platform/gitlab/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,16 @@ export async function initPlatform({
try {
if (!gitAuthor) {
const user = (
await gitlabApi.getJson<{ email: string; name: string; id: number }>(
`user`,
{ token }
)
await gitlabApi.getJson<{
email: string;
name: string;
id: number;
commit_email?: string;
}>(`user`, { token })
).body;
platformConfig.gitAuthor = `${user.name} <${user.email}>`;
platformConfig.gitAuthor = `${user.name} <${
user.commit_email ?? user.email
}>`;
}
// istanbul ignore if: experimental feature
if (process.env.RENOVATE_X_PLATFORM_VERSION) {
Expand Down

0 comments on commit 08bbf81

Please sign in to comment.