Created
January 2, 2018 23:31
-
-
Save lloc/8120e24490ade7bff539d25be0c8f064 to your computer and use it in GitHub Desktop.
Script for the changelog.php post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace lloc\changelog; | |
| exec( 'git fetch --tags' ); | |
| $cmd = 'git tag -l --format="%(creatordate:iso8601)|%(refname:short)" | sort -r'; | |
| $arr = ( new ArrayOutput( $cmd ) )->get(); | |
| $tags = new Tags( $arr ); | |
| $cmd = sprintf( | |
| 'git log %s...%s --pretty=oneline --abbrev-commit', | |
| $tags->get_name( 1 ), | |
| $tags->get_name() | |
| ); | |
| $arr = ( new ArrayOutput( $cmd ) )->get(); | |
| $logs = ( new Logs() )->add( $arr ); | |
| echo $tags->get_title(); | |
| echo $logs->get( 'feat', 'Features' ); | |
| echo $logs->get( 'fix', 'Bug Fixes' ); | |
| echo $logs->get( 'chore', 'Cleanup' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment