Skip to main content

Changelog generator component

Generate a Markdown changelog from the repository's complete Git history with git-cliff and commit the result when its content changes. The generated file is also retained as a pipeline artifact for one week.

The component uses the repository's cliff.toml configuration when present and otherwise uses the git-cliff defaults. Its output path defaults to docs/CHANGELOG.md; the parent directory must already exist.

Because the job can push an automatic commit back to the source branch, provide either GITLAB_TOKEN or GIT_SSH_KEY with write access. The generated commit is pushed with ci.skip, so it does not start another pipeline.

Usage​

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/changelog-generator@stable

Choose another output file or pipeline stage with component inputs:

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/changelog-generator@stable
inputs:
stage: build
file: CHANGELOG.md

By default, the job runs in merge request and branch pipelines and does not run in scheduled pipelines. Override rules when the changelog should be generated in a different pipeline context, and use needs when it depends on another job.

Inputs​

NameDescriptionDefaultType
------------
fileThe Markdown file to generate and commit.docs/CHANGELOG.mdstring
needsThe jobs that this job depends on.[]array
rulesRules that control when the changelog job runs.[{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}]array
stageThe pipeline stage that the job belongs to.buildstring