Skip to content

Instantly share code, notes, and snippets.

@4unkur
Created July 12, 2018 06:02
Show Gist options
  • Save 4unkur/c84170e8a2f6b492ac1bbcc11d0580c0 to your computer and use it in GitHub Desktop.
Save 4unkur/c84170e8a2f6b492ac1bbcc11d0580c0 to your computer and use it in GitHub Desktop.
Package changelog generator from GitLab's RSS feed based on milestone
<?php
// paste rss url here and run the script
$rssUrl = '';
$xml = file_get_contents($rssUrl);
$data = simplexml_load_string($xml);
$html = <<<HTML
<li>Version: x.x.x
<ul>
HTML;
foreach ($data->entry as $issue) {
$matches = [];
if (preg_match('#(\d+)$#', $issue->id, $matches)) {
$number = $matches[1];
}
$html .= <<<HTML
<li>Issue <a href="{$issue->id}" target="_blank">{$number}</a>: {$issue->summary}</li>
HTML;
}
$html .= <<<HTML
</ul>
</li>
HTML;
print $html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment