Skip to content
Snippets Groups Projects
Commit 08bbf812 authored by Michael Kriese's avatar Michael Kriese Committed by Rhys Arkins
Browse files

feat(platform/gitlab)!: prefer `commit_email` (#21122)

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.
parent 61a7813a
No related branches found
No related tags found
No related merge requests found
...@@ -108,12 +108,16 @@ export async function initPlatform({ ...@@ -108,12 +108,16 @@ export async function initPlatform({
try { try {
if (!gitAuthor) { if (!gitAuthor) {
const user = ( const user = (
await gitlabApi.getJson<{ email: string; name: string; id: number }>( await gitlabApi.getJson<{
`user`, email: string;
{ token } name: string;
) id: number;
commit_email?: string;
}>(`user`, { token })
).body; ).body;
platformConfig.gitAuthor = `${user.name} <${user.email}>`; platformConfig.gitAuthor = `${user.name} <${
user.commit_email ?? user.email
}>`;
} }
// istanbul ignore if: experimental feature // istanbul ignore if: experimental feature
if (process.env.RENOVATE_X_PLATFORM_VERSION) { if (process.env.RENOVATE_X_PLATFORM_VERSION) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment