GitLab 集成未返回用户名
作者: nbelsterling创建于 2026年4月25日更新于 2026年8月22日
标签help wantedintegration
Is there an existing issue for this? - [x] 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 4. Make commits authored by your GitLab account credentials (same email)
> Example: https://GitLab.com/nbelste1/git-cliff-example/-/commit/65cd6548a62a7d1e6c573726d6a358b0e0521061 6. 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
> 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](https://GitLab.com/nbelste1/git-cliff-example/-/commit/65cd6548a62a7d1e6c573726d6a358b0e0521061) as authored by a GitLab user below: <img width="845" height="262" alt="Image" src="https://GitHub.com/user-attachments/assets/a4fc84c8-112e-4b68-b456-34302b3ce030" /> ### 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](https://hub.Docker.com/r/orhunp/git-cliff) Docker image ### Additional context After some investigation, it appears the [GitLab commits API](https://docs.GitLab.com/api/commits/#list-repository-commits) and [GitHub commit API](https://docs.GitHub.com/en/rest/commits/commits?apiVersion=2026-03-10#list-commits) differ slightly in their response which [git-cliff-core/src/remote/GitLab.rs](https://GitHub.com/orhun/git-cliff/blob/main/git-cliff-core/src/remote/GitLab.rs) doesn't properly account for. The [GitHub commit API](https://docs.GitHub.com/en/rest/commits/commits?apiVersion=2026-03-10#list-commits) includes the `author` and `committer` while the [GitLab commits API](https://docs.GitLab.com/api/commits/#list-repository-commits) doesn't (and requires an additional API call to get the `author` and `committer` values).内容来源: orhun/git-cliff