From 2a3d7b4923501a4542264f754464ee5c39ae0e48 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sat, 22 Apr 2017 14:45:05 -0700 Subject: [PATCH] add in-reply-to for issue comments --- lib/Formats/GitHub.php | 4 ++++ tests/GitHubTest.php | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/Formats/GitHub.php b/lib/Formats/GitHub.php index d508d59..cc1fb5d 100644 --- a/lib/Formats/GitHub.php +++ b/lib/Formats/GitHub.php @@ -100,6 +100,10 @@ class GitHub { ]; } + if($type == 'comment') { + $entry['in-reply-to'] = ['https://github.com/'.$org.'/'.$repo.'/issues/'.$issue]; + } + if(!empty($data['labels'])) { $entry['category'] = array_map(function($l){ return $l['name']; diff --git a/tests/GitHubTest.php b/tests/GitHubTest.php index 4ab5272..6aef9c1 100644 --- a/tests/GitHubTest.php +++ b/tests/GitHubTest.php @@ -102,6 +102,7 @@ class GitHubTest extends PHPUnit_Framework_TestCase { $this->assertContains('', $data['data']['content']['html']); $this->assertContains('```php', $data['data']['content']['text']); $this->assertNotContains('name', $data['data']); + $this->assertContains('https://github.com/aaronpk/XRay/issues/25', $data['data']['in-reply-to']); }