2017 © Pedro Peláez
 

library github-changelog-generator

Creates a markdown changelog for your GitHub repository.

image

ins0/github-changelog-generator

Creates a markdown changelog for your GitHub repository.

  • Tuesday, July 3, 2018
  • by ins0
  • Repository
  • 3 Watchers
  • 10 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 6 Versions
  • 9 % Grown

The README.md

GitHub ChangelogGenerator

Creates a markdown changelog for your repository, based on your repository's releases, issues and pull-requests. Inspired by github-changelog-generator for Ruby., (*1)

Installation

Composer

$ composer require ins0/github-changelog-generator

Usage

Note: You can see an example of the output generated, here., (*2)

PHP

<?php
require_once 'vendor/autoload.php';

$token = '...';   // The token is not required, but is still recommended.
$repository = new ins0\GitHub\Repository('ins0/github-changelog-generator', $token);
$changelog = new ins0\GitHub\ChangelogGenerator($repository);

// The ChangelogGenerator::generate() method does throw
// exceptions, so remember to wrap your code in try/catch blocks.
try {
    $handle = fopen('CHANGELOG.md', 'w');

    if (!$handle) {
        throw new RuntimeException('Cannot open file for writing');
    }

    // Write markdown output to file
    fwrite($handle, $changelog->generate());
    fclose($handle);
} catch (Exception $e) {
    // handle exceptions...
}

If your repository uses labels other than feature, bug or enhancement you can customize them, like so:, (*3)

require_once 'vendor/autoload.php';

$labelMappings = [
    ins0\GitHub\ChangelogGenerator::LABEL_TYPE_ADDED => ['feature', 'anotherFeatureLabel'],
    ins0\GitHub\ChangelogGenerator::LABEL_TYPE_CHANGED => ['enhancement', 'anotherEnhancementLabel'],
    ins0\GitHub\ChangelogGenerator::LABEL_TYPE_FIXED => ['bug', 'anotherBugLabel']
];

$changelog = new ins0\GitHub\ChangelogGenerator($repository, $labelMappings);

If you would like to customize the section headers, you can override the built in ones or add additional, (*4)

require_once 'vendor/autoload.php';

$typeHeadings = [
    ins0\GitHub\ChangelogGenerator::LABEL_TYPE_ADDED => '### New stuff!'
];

$changelog = new ins0\GitHub\ChangelogGenerator($repository, [], $labelHeaders);

CLI

$ php vendor/bin/github-changelog-generator ins0/github-changelog-generator > CHANGELOG.md

CLI

This command line tool supports output redirection/pipelining, unless the --file option is provided., (*5)

Required: - [repository]: The url to your GitHub repository, without the domain. E.g. ins0/github-changelog-generator, (*6)

Boolean: - This tool does not use any boolean flags., (*7)

Optional: - --token (-t): Your GithHub OAUTH token. - --file (-f): Write output to a file. - --help: Access the help menu., (*8)

Exit Codes: - 0: success - 1: fail, (*9)

Testing

This library uses the PHPUnit test suite., (*10)

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*11)

Security

If you discover any security related issues, please email rieger@racecore.de instead of using the issue tracker., (*12)

Credits

License

The MIT License (MIT). Please see the LICENSE file for more information., (*13)

The Versions

03/07 2018

dev-master

9999999-dev

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog

03/07 2018

dev-upgrade/php7

dev-upgrade/php7

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog

04/05 2018

v0.3.0

0.3.0.0

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog

05/11 2017

v0.2.1

0.2.1.0

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog

02/09 2017

v0.2.0

0.2.0.0

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog

19/04 2016

v0.0.1

0.0.1.0

Creates a markdown changelog for your GitHub repository.

  Sources   Download

MIT

The Requires

 

The Development Requires

generator markdown github changelog keepachangelog