2017 © Pedro PelĂĄez
 

library github-changelog

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

image

localheinz/github-changelog

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  • Sunday, June 3, 2018
  • by localheinz
  • Repository
  • 3 Watchers
  • 29 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 6 Open issues
  • 19 Versions
  • 4 % Grown

The README.md

github-changelog

Integrate Prune Release Renew, (*1)

Code Coverage Type Coverage, (*2)

Latest Stable Version Total Downloads, (*3)

Provides a script that generates a changelog based on titles of pull requests merged between specified references., (*4)

Is this the right tool for me?

Probably not. There are a range of other tools that probably do a better job., (*5)

Take a look at, (*6)

  • https://packagist.org/?q=changelog
  • https://www.npmjs.com/search?q=changelog
  • https://pypi.python.org/pypi?%3Aaction=search&term=changelog

Nonetheless, for me and my projects, it's the second best thing after manually keeping a changelog as suggested at http://keepachangelog.com., (*7)

When will it work for me?

My process Will this tool work for me?
I need elaborate changelogs No
I push directly into the default branch No
Rebase and merge No
Squash and merge No
Merge pull request Yes

Why is this tool so limited?

All this tool does is this:, (*8)

  • it collects commits between references
  • it matches commit messages against what is used by GitHub as a merge commit message
  • it fetches the pull request title from the corresponding pull request
  • it then uses all of the pull request titles to compile a list

CLI Tool

Global installation

Install globally:, (*9)

$ composer global require ergebnis/github-changelog

Create your changelogs from within a Git repository:, (*10)

$ git clone git@github.com:ergebnis/github-changelog.git
$ cd github-changelog
$ github-changelog generate 0.1.1 0.1.2

Create your changelogs from anywhere, specifying the repository using the --repository option:, (*11)

$ github-changelog generate --repository ergebnis/github-changelog 0.1.1 0.1.2

Enjoy the changelog:, (*12)

- Fix: Catch exceptions in command (#37), by @localheinz
- Fix: Request 250 instead of 30 commits (#38), by @localheinz

Local installation

Install locally:, (*13)

$ composer require --dev ergebnis/github-changelog

Create your changelog from within in your project:, (*14)

$ vendor/bin/github-changelog generate ergebnis/github-changelog ae63248 main

Enjoy the changelog:, (*15)

- Enhancement: Create ChangeLog command (#31), by @localheinz
- Fix: Assert exit code is set to 0 (#32), by @localheinz
- Enhancement: Add console application (#33), by @localheinz
- Fix: Readme (#34), by @localheinz
- Fix: Autoloading for console script (#35), by @localheinz
- Fix: Version foo with rebasing and whatnot (#36), by @localheinz
- Fix: Catch exceptions in command (#37), by @localheinz
- Fix: Request 250 instead of 30 commits (#38), by @localheinz

Userland Code

Install locally:, (*16)

$ composer require ergebnis/github-changelog

Retrieve pull requests between references in your application:, (*17)

<?php

require 'vendor/autoload.php';

use Github\Client;
use Github\HttpClient\CachedHttpClient;
use Ergebnis\GitHub\Changelog\Repository;
use Ergebnis\GitHub\Changelog\Resource;

$client = new Client(new CachedHttpClient());
$client->authenticate(
    'your-token-here',
    Client::AUTH_HTTP_TOKEN
);

$pullRequestRepository = new Repository\PullRequestRepository(
    $client->pullRequests(),
    new Repository\CommitRepository($client->repositories()->commits())
);

/* @var Resource\RangeInterface $range */
$range = $repository->items(
    Resource\Repository::fromString('ergebnis/github-changelog'),
    '0.1.1',
    '0.1.2'
);

$pullRequests = $range->pullRequests();

array_walk($pullRequests, function (Resource\PullRequestInterface $pullRequest) {
    echo sprintf(
        '- %s (#%d), submitted by @%s' . PHP_EOL,
        $pullRequest->title(),
        $pullRequest->number(),
        $pullRequest->author()->login(),
    );
});

Enjoy the changelog:, (*18)

- Fix: Catch exceptions in command (#37), submitted by @localheinz
- Fix: Request 250 instead of 30 commits (#38), submitted by @localheinz

Hints

:bulb: You can use anything for a reference, e.g., a tag, a branch, a commit!, (*19)

Changelog

Please have a look at CHANGELOG.md., (*20)

Contributing

Please have a look at CONTRIBUTING.md., (*21)

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md., (*22)

License

This package is licensed using the MIT License., (*23)

Please have a look at LICENSE.md., (*24)

Curious what I am building?

:mailbox_with_mail: Subscribe to my list, and I will occasionally send you an email to let you know what I am working on., (*25)

The Versions

03/06 2018

dev-master

9999999-dev https://github.com/localheinz/github-changelog

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

27/01 2018

dev-feature/urls

dev-feature/urls https://github.com/localheinz/github-changelog

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

16/11 2017

0.6.1

0.6.1.0

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

25/10 2017

0.6.0

0.6.0.0

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

22/10 2017

dev-feature/range-not-found

dev-feature/range-not-found

Provides a script that generates a changelog based on titles of pull requests merged between specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

01/04 2017

dev-feature/php-cs-fixer-config

dev-feature/php-cs-fixer-config

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

09/08 2015

0.3.0

0.3.0.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

09/08 2015

0.2.1

0.2.1.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

09/08 2015

0.2.0

0.2.0.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

27/05 2015

0.1.5

0.1.5.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

27/05 2015

0.1.4

0.1.4.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

04/03 2015

0.1.3

0.1.3.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

02/03 2015

0.1.2

0.1.2.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

02/03 2015

0.1.1

0.1.1.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller

02/03 2015

0.1.0

0.1.0.0

A script that generates a change log based on specified references.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Andreas Möller