$author =
$changelog->
getDefinition()->
getAuthor() ?? '';
$authorEmail =
$changelog->
getDefinition()->
getAuthorEmail() ?? '';
$github =
$changelog->
getDefinition()->
getAuthorGitHub() ?? '';
if (!
empty($author) && !
empty($github) && !
empty($authorEmail) && !
str_contains($authorEmail, '@shopware.com'
)) { $log .=
sprintf(' ([%s](https://github.com/%s))',
$author,
str_replace('@', '',
$github));
} $append[] =
$log;
} if (!
$dryRun) { $content =
file_get_contents($this->
getChangelogGlobal()) ?: '';
$posLatestRelease =
strpos($content, '## '
);
$posLatestRelease =
$posLatestRelease ?: 0;
$content =
substr($content, 0,
$posLatestRelease) .
implode("\n",
$append) . "\n\n"
.
substr($content,
$posLatestRelease);
file_put_contents($this->
getChangelogGlobal(),
$content);
$output[] = '* Update the CHANGELOG.md file';
}