zenozeng / gitlab-changelog
A simple php script to generate changelog via gitlab API v3
Installs: 3 657
Dependents: 0
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 6
Open Issues: 0
Requires
- php: >=5.4.0
This package is not auto-updated.
Last update: 2024-12-21 17:38:13 UTC
README
A php script to generate changelog via gitlab api v3
Usage
composer.json:
{ "require": { "zenozeng/gitlab-changelog": "0.1.1" } }
index.php:
<?php require "vendor/autoload.php"; use GitlabChangelog\GitlabChangelog; $changelog = new GitlabChangelog(); $changelog->url = "http://gitlab.alibaba-inc.com/"; $changelog->repo = "ata/atatech-kb"; $changelog->token = "YOUR PRIVATE TOKEN"; $changelog->milestoneFilter = function($milestone) { $ignore = array("todo", "long running task", "team", "next release"); return !in_array($milestone->title, $ignore); }; $changelog->getLabels = function($issue) { $label = "Fixed"; $map = array( "bug" => "Fixed", "enhancement" => "Improved", "feature" => "Added" ); foreach($map as $k => $v) { if(strripos(implode(',', $issue->labels), $k) !== FALSE) { $label = $v; break; } } return array($label); }; $changelog->debug = true; $markdown = $changelog->markdown(); file_put_contents("changelog.md", $markdown); ?>
Run:
composer install php index.php