Add GitHub link

Add GitHub link

From 96c657c985268989ec3085e11c5f292444863fe1 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Mon, 19 Nov 2018 18:04:58 +1100
Subject: [PATCH] Add GitHub link


diff --git a/jobs/import_commits.rb b/jobs/import_commits.rb
index 8188557..eda0232 100644
--- a/jobs/import_commits.rb
+++ b/jobs/import_commits.rb
@@ -9,8 +9,12 @@ module Jobs
 
       DiscourseCodeReview.commits_since.each do |commit|
 
+        link = <<~LINK
+          [<small>GitHub</small>](https://github.com/#{SiteSetting.code_review_github_repo}/commit/#{commit[:hash]})
+        LINK
+
         title = commit[:subject]
-        raw = commit[:body] + "\n\n```diff\n#{commit[:diff]}\n```"
+        raw = commit[:body] + "\n\n```diff\n#{commit[:diff]}\n```\n#{link}"
 
         user = ensure_user(
           email: commit[:email],

GitHub

1 Like