diff --git a/lib/github.js b/lib/github.js index 9fcfacb..3492a56 100644 --- a/lib/github.js +++ b/lib/github.js @@ -44,10 +44,15 @@ const splittedURL = fullURL => { // ...and then remove it from the parts pathParts.splice(0, 2) - return { - main, - ref: pathParts.length >= 2 ? pathParts[1] : '' + // Assign Git reference + let ref = pathParts.length >= 2 ? pathParts[1] : '' + + // Shorten SHA for commits + if (pathParts[0] && pathParts[0] === 'commit') { + ref = ref.substring(0, 7) } + + return {main, ref} } export const gitPathParts = main => {