forked from chrisboulton/php-diff
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgenerateChangelog.php
More file actions
30 lines (24 loc) · 796 Bytes
/
generateChangelog.php
File metadata and controls
30 lines (24 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
use DigiLive\GitChangelog\Renderers\MarkDown;
require 'vendor/autoload.php';
$changelogOptions = [
'headTagName' => '2.5.0',
'headTagDate' => '2025-10-06',
'titleOrder' => 'ASC',
];
$changelogLabels = ['Add', 'Cut', 'Fix', 'Bump', 'Document','Optimize'];
$changeLog = new MarkDown();
$changeLog->setUrl('commit', 'https://github.com/JBlond/php-diff/commit/{commit}');
$changeLog->setUrl('issue', 'https://github.com/JBlond/php-diff/issues/{issue}');
try {
$changeLog->setOptions($changelogOptions);
} catch (Exception $exception) {
echo $exception->getMessage();
}
$changeLog->setLabels(...$changelogLabels);
try {
$changeLog->build();
} catch (Exception $exception) {
echo $exception->getMessage();
}
file_put_contents('changelog.md', $changeLog->get());