orhun/git-cliff

GitLab Integration not returning username

开放

#1,492 创建于 2026年4月25日

 (4 条评论) (1 个反应) (0 位负责人)Rust (308 个派生)auto 404
help wantedintegration

仓库指标

星标
 (12,040 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is there an existing issue for this?

  • I have searched the existing issues

Description of the bug

When generating the Changelog for a repository using the GitLab integration, the commit author is used instead of the GitLab username. This behavior is unexpected and goes against the current GitLab Integration documentation.

Steps To Reproduce

To reproduce this bug:

  1. Setup a GitLab project to use git-cliff:
    [remote.gitlab]
    owner = "nbelste1"
    repo = "git-cliff-example"
    

    Example: https://gitlab.com/nbelste1/git-cliff-example/-/blob/feature/init/cliff.toml

  2. Set up a GitLab CI/CD pipeline job to run using the integration

    Example: https://gitlab.com/nbelste1/git-cliff-example/-/blob/feature/init/.gitlab-ci.yml

  3. Make commits authored by your GitLab account credentials (same email)

    Example: https://gitlab.com/nbelste1/git-cliff-example/-/commit/65cd6548a62a7d1e6c573726d6a358b0e0521061

  4. Review the Changelog generated by git-cliff -r .
    ## What's Changed
    * initial README by @Nathan Belsterling
    * git-cliff setup
    
    ### New Contributors
    * @Nathan Belsterling made their first contribution
    
    <!-- generated by git-cliff -->
    

    Source: https://gitlab.com/nbelste1/git-cliff-example/-/jobs/14090146226/artifacts/file/CHANGELOG.md

Expected behavior

The following Changelog is generated:

## What's Changed
* initial README by @nbelste1
* git-cliff setup

### New Contributors
* @nbelste1 made their first contribution

<!-- generated by git-cliff -->

Screenshots / Logs

You can see that GitLab properly recognized commit 65cd6548a62a7d1e6c573726d6a358b0e0521061 as authored by a GitLab user below:

Software information

  • Operating system: Debian GNU/Linux 12.12 (bookworm)
  • Rust version: N/A (Rust not included in official Docker image)
  • Project version: git-cliff 2.12.0

Used the official orhun/git-cliff Docker image

Additional context

After some investigation, it appears the GitLab commits API and GitHub commit API differ slightly in their response which git-cliff-core/src/remote/gitlab.rs doesn't properly account for. The GitHub commit API includes the author and committer while the GitLab commits API doesn't (and requires an additional API call). Rather than making the additional call, git-cliff-core/src/remote/gitlab.rs just places the commit.author.name in the remote.username field.

贡献者指南