Skip to content

Commit

Permalink
ci: silence changelog generator warning emission, not useful when run…
Browse files Browse the repository at this point in the history
…ning by hand (#814)
  • Loading branch information
braindigitalis authored Aug 28, 2023
1 parent e7d63d3 commit 95598a6
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions buildtools/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
$errors = [];

// Magic sauce
exec("git log --format=\"%s\" $(git log --no-walk --tags | head -n1 | cut -d ' ' -f 2)..HEAD | grep -v '^Merge '", $changelog);
exec("git log --oneline --format=\"%s\" $(git log --no-walk --tags | head -n1 | cut -d ' ' -f 2)..HEAD | grep -v '^Merge '", $changelog);

// Case insensitive removal of duplicates
$changelog = array_intersect_key($changelog, array_unique(array_map("strtolower", $changelog)));
Expand Down Expand Up @@ -193,7 +193,7 @@ function add_change(string $change, string $category, string $scope = null) {
if ($githubstyle) {
echo "The changelog is listed below:\n\nRelease Changelog\n===========\n";
} else {
echo "The changelog is listed below:\n\n__**Release Changelog**__\n";
echo "The changelog is listed below:\n\n## Release Changelog\n";
}

function print_change(string $change) {
Expand All @@ -208,7 +208,7 @@ function print_change(string $change) {
// Output tidy formatting
foreach ($catgroup as $cat => $list) {
if (!empty($list)) {
echo "\n" . ($githubstyle ? '## ' : '__**') . $cat . ($githubstyle ? '' : '**__') . "\n";
echo "\n" . ($githubstyle ? '## ' : '### ') . $cat . "\n";
foreach ($list as $key => $item) {
if (is_array($item)) {
foreach ($item as $change) {
Expand All @@ -230,6 +230,13 @@ function print_change(string $change) {
echo "\n";
}

foreach ($errors as $err) {
trigger_error($err, E_USER_WARNING);
}
/*
* Disabled as it generates pages and pages of stack traces, making it
* extremely difficult to copy and paste the error log when running this
* on the command line for sending discord announcement changelogs.
*
* foreach ($errors as $err) {
* trigger_error($err, E_USER_WARNING);
* }
*
*/

0 comments on commit 95598a6

Please sign in to comment.