mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
fixes #708, script to extract issues from Github
This commit is contained in:
parent
346f5c3849
commit
ea382e85bf
1 changed files with 55 additions and 0 deletions
55
tools/github_issues.php
Normal file
55
tools/github_issues.php
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
<?php
|
||||||
|
// A) requirements
|
||||||
|
//
|
||||||
|
// curl -s http://getcomposer.org/installer | php
|
||||||
|
// php composer.phar require knplabs/github-api php-http/guzzle6-adapter
|
||||||
|
//
|
||||||
|
// B) usage
|
||||||
|
//
|
||||||
|
// php gh.php --milestone=2.8.4 --html
|
||||||
|
|
||||||
|
$opt = getopt('', array('milestone:', 'html'));
|
||||||
|
|
||||||
|
$mandatory_fields = array('milestone');
|
||||||
|
foreach ($mandatory_fields as $field)
|
||||||
|
{
|
||||||
|
if (!isset($opt[$field]))
|
||||||
|
{
|
||||||
|
die('missing --'.$field."\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This file is generated by Composer
|
||||||
|
require_once 'vendor/autoload.php';
|
||||||
|
|
||||||
|
$client = new \Github\Client();
|
||||||
|
$milestones = $client->api('issue')->milestones()->all('Piwigo', 'Piwigo');
|
||||||
|
|
||||||
|
$milestone_number = null;
|
||||||
|
|
||||||
|
foreach ($milestones as $milestone)
|
||||||
|
{
|
||||||
|
if ($milestone['title'] == $opt['milestone'])
|
||||||
|
{
|
||||||
|
$milestone_number = $milestone['number'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_null($milestone_number))
|
||||||
|
{
|
||||||
|
die('milestone '.$opt['milestone'].' not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$issues = $client->api('issue')->all('Piwigo', 'Piwigo', array('milestone' => $milestone_number, 'state' => 'closed'));
|
||||||
|
|
||||||
|
foreach ($issues as $issue)
|
||||||
|
{
|
||||||
|
if (isset($opt['html']))
|
||||||
|
{
|
||||||
|
echo '<li><a href="'.$issue['html_url'].'">#'.$issue['number'].'</a>: '.$issue['title'].'</li>'."\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo '#'.$issue['number'].' '.$issue['title']."\n";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue