{"id":14008395,"url":"https://github.com/jenkinsci/git-changelog-plugin","last_synced_at":"2025-04-06T15:12:31.132Z","repository":{"id":1639704,"uuid":"43630800","full_name":"jenkinsci/git-changelog-plugin","owner":"jenkinsci","description":"Creates a changelog, or release notes, based on Git commits between 2 revisions.","archived":false,"fork":false,"pushed_at":"2025-03-17T17:26:37.000Z","size":1196,"stargazers_count":56,"open_issues_count":5,"forks_count":34,"subscribers_count":104,"default_branch":"master","last_synced_at":"2025-03-30T13:09:18.664Z","etag":null,"topics":["changelog","changelog-generator","release-automation","release-notes"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/git-changelog","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"paulwellnerbou/git-changelog-jenkins-plugin","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["tomasbjerre"]}},"created_at":"2015-10-04T09:07:37.000Z","updated_at":"2025-03-17T17:26:40.000Z","dependencies_parsed_at":"2023-07-05T21:16:31.074Z","dependency_job_id":"7d572aa9-7de1-407e-8f24-77bb130dd160","html_url":"https://github.com/jenkinsci/git-changelog-plugin","commit_stats":null,"previous_names":[],"tags_count":130,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fgit-changelog-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fgit-changelog-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fgit-changelog-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fgit-changelog-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/git-changelog-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247500469,"owners_count":20948880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["changelog","changelog-generator","release-automation","release-notes"],"created_at":"2024-08-10T11:01:38.717Z","updated_at":"2025-04-06T15:12:31.113Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":["https://github.com/sponsors/tomasbjerre"],"categories":["Java"],"sub_categories":[],"readme":"# Git Changelog Plugin\n\n[![Build Status](https://ci.jenkins.io/job/Plugins/job/git-changelog-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/git-changelog-plugin)\n\nCreates a changelog, or release notes, based on Git commits between 2 revisions.\n\nThis can also be done with a [command line tool](https://github.com/tomasbjerre/git-changelog-command-line).\n\n# Usage\n\nYou can use this plugin either in a **pipeline** or as a **post-build action**.\n\nThere is a complete running example available here: https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox\n\n## Pipeline\n\nThe plugin is compatible with the [pipeline plugin](https://jenkins.io/doc/book/pipeline/getting-started/) and can be configured to support many use cases. You probably want to adjust it using the [Snippet Generator](https://jenkins.io/doc/book/pipeline/getting-started/#snippet-generator).\n\nThe `gitChangelog` step can return:\n\n- **Context** - An object that contains all the information needed to create a changelog. Can be used to gather information from Git like committers, emails, issues and much more.\n- **String** - A string that is a rendered changelog, ready to be published. Can be used to publish on build summary page, on a wiki, emailed and much more.\n\nThe template and context is [documented here](https://github.com/tomasbjerre/git-changelog-lib).\n\nIt can integrate with issue management systems to get titles of issues and links. You will probably want to avoid specifying credentials in plain text in your script. One way of doing that is using the [credentials binding plugin](https://jenkins.io/doc/pipeline/steps/credentials-binding/). The supported integrations are:\n\n- GitLab\n- GitHub\n- Jira\n\nYou can [create a file](https://jenkins.io/doc/pipeline/examples/) or maybe publish the changelog with:\n\n- [HTML Publisher Plugin](https://plugins.jenkins.io/htmlpublisher)\n- [Confluence Publisher Plugin](https://plugins.jenkins.io/confluence-publisher)\n- [Email Extension](https://plugins.jenkins.io/email-ext)\n\nYou can filter out a subset of the commits by:\n\n- Specifying specific **from**/**to** **references**/**commits**.\n- Adding filter based on message.\n- Adding filter based on commit time.\n- Filter tags based on tag name.\n- Filter commits based on commit time.\n- Ignore commits that does not contain an issue.\n\nYou can make the changelog prettier by:\n\n- Transforming tag name to something more readable.\n- Changing date display format.\n- Creating virtual tag, that contains all commits that does not belong to any other tag. This can be named something like _Unreleased_.\n- Creating virtual issue, that contains all commits that does not belong to any other issue.\n- Remove issue from commit message. This can be named something like _Wall of shame_ and list all committers that did not commit on an issue.\n\nCheck the [Snippet Generator](https://jenkins.io/doc/book/pipeline/getting-started/#snippet-generator) to see all features!\n\n### Pipeline with context\n\nHere is an example that clones a repo, gathers all jiras and adds a link to jira in the description of the job. The context contains much more then this and is [documented here](https://github.com/tomasbjerre/git-changelog-lib).\n\n```groovy\nnode {\n deleteDir()\n sh \"\"\"\n git clone git@github.com:jenkinsci/git-changelog-plugin.git .\n \"\"\"\n\n def changelogContext = gitChangelog returnType: 'CONTEXT',\n  from: [type: 'REF', value: 'git-changelog-1.50'],\n  to: [type: 'REF', value: 'master'],\n  jira: [issuePattern: 'JENKINS-([0-9]+)\\\\b', password: '', server: '', username: '']\n\n Set\u003cString\u003e issueIdentifiers = new TreeSet\u003c\u003e()\n changelogContext.issues.each { issue -\u003e\n  if (issue.name == 'Jira') {\n   issueIdentifiers.add(issue.issue)\n  }\n }\n currentBuild.description = \"http://jira.com/issues/?jql=key%20in%20%28${issueIdentifiers.join(',')}%29\"\n}\n```\n\n### Pipeline with string\n\nHere is an example that clones a repo and publishes the changelog on job page. The template and context is [documented here](https://github.com/tomasbjerre/git-changelog-lib).\n\n```groovy\nnode {\n deleteDir()\n sh \"\"\"\n git clone git@github.com:jenkinsci/git-changelog-plugin.git .\n \"\"\"\n\n def changelogString = gitChangelog returnType: 'STRING',\n  from: [type: 'REF', value: 'git-changelog-1.50'],\n  to: [type: 'REF', value: 'master'],\n  template: \"\"\"\n  // Template is documented below!\n  \"\"\"\n\n currentBuild.description = changelogString\n}\n```\n\n### Determine next version from commit messages\n\nBy giving the plugin patterns, to match against commits, it can calculate next semantic version to use. This can be part of a release-pipeline, to automate version stepping. It will find the previous highest semantic Git tag and step it depending of matched patterns.\n\n```groovy\ndef nextVersion = getNextSemanticVersion()\nprintln \"Next version:\" + nextVersion.toString();\nprintln \" Major:\" + nextVersion.getMajor();\nprintln \" Minor:\" + nextVersion.getMinor();\nprintln \" Patch:\" + nextVersion.getPatch();\n```\n\nYou can also specify custom regexp to match against commits:\n\n```groovy\ndef nextVersion = getNextSemanticVersion majorPattern: '^[Bb]reaking.*',\n    minorPattern: '^[Ff]eature.*',\n    patchPattern: '^[Ff]ix.*'\n```\n\n### Determine highest version from commit messages\n\nThe plugin can find the previous highest semantic Git tag and provide major/minor/path numbers as well as the tag.\n\n```groovy\ndef highestVersion = getHighestSemanticVersion()\nprintln \"Highest version:\" + highestVersion.toString();\nprintln \" Major:\" + highestVersion.getMajor();\nprintln \" Minor:\" + highestVersion.getMinor();\nprintln \" Patch:\" + highestVersion.getPatch();\nprintln \" Git tag:\" + highestVersion.findTag().orElse(\"\");\n```\n\n### Templates\n\nThe template and context is [documented here](https://github.com/tomasbjerre/git-changelog-lib).\n\n#### Template - Simple\n\n```hbs\n{{#tags}}\n## {{name}}\n {{#issues}}\n  {{#hasIssue}}\n   {{#hasLink}}\n### {{name}} [{{issue}}]({{link}}) {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}\n   {{/hasLink}}\n   {{^hasLink}}\n### {{name}} {{issue}} {{title}} {{#hasIssueType}} *{{issueType}}* {{/hasIssueType}} {{#hasLabels}} {{#labels}} *{{.}}* {{/labels}} {{/hasLabels}}\n   {{/hasLink}}\n  {{/hasIssue}}\n  {{^hasIssue}}\n### {{name}}\n  {{/hasIssue}}\n\n  {{#commits}}\n**{{{messageTitle}}}**\n\n{{#messageBodyItems}}\n * {{.}}\n{{/messageBodyItems}}\n\n[{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}) {{authorName}} *{{commitTime}}*\n\n  {{/commits}}\n\n {{/issues}}\n{{/tags}}\n```\n\n#### Template - Semantic versioning from conventional commits\n\nIf you are using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/):\n\n```shell\n\u003ctype\u003e[optional scope]: \u003cdescription\u003e\n\n[optional body]\n\n[optional footer(s)]\n```\n\nA changelog can be rendered (using [Helpers](https://github.com/tomasbjerre/git-changelog-lib#Helpers)) like this:\n\n```hbs\n# Changelog\n\n{{#tags}}\n{{#ifReleaseTag .}}\n## [{{name}}](https://gitservice/{{name}}) ({{tagDate .}})\n\n  {{#ifContainsType commits type='feat'}}\n### Features\n\n    {{#commits}}\n      {{#ifCommitType . type='feat'}}\n - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))\n      {{/ifCommitType}}\n    {{/commits}}\n  {{/ifContainsType}}\n\n  {{#ifContainsType commits type='fix'}}\n### Bug Fixes\n\n    {{#commits}}\n      {{#ifCommitType . type='fix'}}\n - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://gitservice/commit/{{hashFull}}))\n      {{/ifCommitType}}\n    {{/commits}}\n  {{/ifContainsType}}\n\n{{/ifReleaseTag}}\n{{/tags}}\n```\n\n## Post-build action\n\nWhen the plugin is installed, it will add a new post build action in Jenkins job configuration.\n\n- **Git Changelog** - Implements features from [git-changelog-lib](https://github.com/tomasbjerre/git-changelog-lib).\n\n### Git Changelog\n\nA couple of revisions are configured along with some other optional features. A editable template is available for the user to tweak.\n\n![Select references](/doc/imgs/git-changelog-references.png)\n\nThe changelog is created from parsing Git and rendering the template with a context derived from the configured revisions.\n\n![Tweak template](/doc/imgs/git-changelog-file.png)\n\n# Development\n\nThis plugin can be built and started with maven and Jenkins' hpi plugin:\n\n```\n./run.sh\n```\n\nThe functionality is implemented in [git-changelog-lib](https://github.com/tomasbjerre/git-changelog-lib). Pull requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fgit-changelog-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fgit-changelog-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fgit-changelog-plugin/lists"}