mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added docs for generating changelog + fixed some code (#8845)
This commit is contained in:
committed by
Tony Murray
parent
e2c698bc68
commit
c6fc763586
@@ -78,7 +78,7 @@ class GitHub
|
||||
*/
|
||||
public function getRelease($tag)
|
||||
{
|
||||
$release = Requests::get($this->github . "/releases/tags/$tag", self::getHeaders());
|
||||
$release = Requests::get($this->github . "/releases/tags/$tag", $this->getHeaders());
|
||||
return json_decode($release->body, true);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class GitHub
|
||||
*/
|
||||
public function getPullRequest()
|
||||
{
|
||||
$pull_request = Requests::get($this->github . "/pulls/{$this->pr}", self::getHeaders());
|
||||
$pull_request = Requests::get($this->github . "/pulls/{$this->pr}", $this->getHeaders());
|
||||
$this->pr = json_decode($pull_request->body, true);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class GitHub
|
||||
*/
|
||||
public function getPullRequests($date, $page = 1)
|
||||
{
|
||||
$prs = Requests::get($this->github . "/pulls?state=closed&page=$page", self::getHeaders());
|
||||
$prs = Requests::get($this->github . "/pulls?state=closed&page=$page", $this->getHeaders());
|
||||
$prs = json_decode($prs->body, true);
|
||||
foreach ($prs as $k => $pr) {
|
||||
if ($pr['merged_at']) {
|
||||
@@ -139,7 +139,7 @@ class GitHub
|
||||
$users[$pr['user']['login']] = 0;
|
||||
}
|
||||
if ($pr['merged_at']) {
|
||||
foreach ($pr['labels'] as $k => $label) {
|
||||
foreach ($pr['labels'] as $key => $label) {
|
||||
$name = preg_replace('/ :[\S]+:/', '', strtolower($label['name']));
|
||||
if (in_array($name, $this->labels)) {
|
||||
$title = ucfirst(trim(preg_replace('/^[\S]+: /', '', $pr['title'])));
|
||||
@@ -214,7 +214,7 @@ class GitHub
|
||||
//FIXME Come back to this
|
||||
return false;
|
||||
$sha = isset($this->pr['merge_commit_sha']) ? $this->pr['merge_commit_sha'] : 'master';
|
||||
$release = Requests::post($this->github . "/releases", self::getHeaders(), [
|
||||
$release = Requests::post($this->github . "/releases", $this->getHeaders(), [
|
||||
'tag_name' => $this->tag,
|
||||
'target_commitish' => $sha,
|
||||
'body' => $this->getMarkdown(),
|
||||
|
Reference in New Issue
Block a user