FEATURE: Send only regular posts to GitHub

FEATURE: Send only regular posts to GitHub

diff --git a/plugin.rb b/plugin.rb
index 033dbf7..78b8e53 100644
--- a/plugin.rb
+++ b/plugin.rb
@@ -124,7 +124,7 @@ after_initialize do
       hash = topic&.custom_fields[DiscourseCodeReview::COMMIT_HASH]
       user = post.user
 
-      if post.post_number > 1 && !post.whisper? && post.raw.present? && topic && hash && user
+      if post.post_number > 1 && post.post_type == Post.types[:regular] && post.raw.present? && topic && hash && user
         if !post.custom_fields[DiscourseCodeReview::GITHUB_ID]
           fields = post.reply_to_post&.custom_fields || {}
           path = fields[DiscourseCodeReview::COMMENT_PATH]
diff --git a/spec/plugin_spec.rb b/spec/plugin_spec.rb
index 8eb3d11..0c53f4e 100644
--- a/spec/plugin_spec.rb
+++ b/spec/plugin_spec.rb
@@ -170,6 +170,26 @@ describe DiscourseCodeReview do
           expect(client.call[:body]).to include(user.username)
         end
       end
+
+      context "when reply is a whisper" do
+        before { reply.post_type = Post.types[:whisper] }
+
+        it "does not send the reply to github" do
+          client.expects(:create_commit_comment).never
+
+          DiscourseCodeReview.sync_post_to_github(client, reply)
+        end
+      end
+
+      context "when reply is a small action" do
+        before { reply.post_type = Post.types[:small_action] }
+
+        it "does not send the reply to github" do
+          client.expects(:create_commit_comment).never
+
+          DiscourseCodeReview.sync_post_to_github(client, reply)
+        end
+      end
     end
   end
 end

GitHub sha: 7ea7fc99

This commit appears in #21 which was approved by @danielwaterworth. It was merged by @danielwaterworth.