Created
July 12, 2018 06:02
-
-
Save 4unkur/c84170e8a2f6b492ac1bbcc11d0580c0 to your computer and use it in GitHub Desktop.
Package changelog generator from GitLab's RSS feed based on milestone
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 | |
// 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