diff --git a/lib/get-commit.js b/lib/get-commit.js index 17148be8..107ba370 100644 --- a/lib/get-commit.js +++ b/lib/get-commit.js @@ -11,7 +11,7 @@ function getCommit (state) { .then(function (result) { const {filename, patch, blob_url} = result.data.files[0] - var newBlobUrl = blob_url.replace(/(?:blob)(.+)(?=\/)/g, 'blob/' + state.branch) + var newBlobUrl = blob_url.replace(/(?:blob)(.+)(?=\/)/g, 'blob/' + state.repoDefaultBranch) state.commit = { message: result.data.commit.message, diff --git a/lib/handle-create-event.js b/lib/handle-create-event.js index 0c743a77..10be0ae0 100644 --- a/lib/handle-create-event.js +++ b/lib/handle-create-event.js @@ -34,7 +34,8 @@ function handleCreateEvent (context) { branch: ref, template, labels: ['first-timers-only', 'hacktoberfest'], - sha: null + sha: null, + repoDefaultBranch: repository.default_branch } getBranch(state)