Comparing version 1.0.3 to 1.0.4
@@ -158,5 +158,6 @@ /* | ||
var tag = ''; | ||
var rRef = /refs\/(tags|heads)\/(.*)$/; | ||
// break out if it was a tag or branch and assign | ||
var refMatches = ( payload.ref || "" ).match( /refs\/(tags|heads)\/(.*)$/ ); | ||
var refMatches = ( payload.ref || "" ).match( rRef ); | ||
if ( refMatches ) { | ||
@@ -171,2 +172,7 @@ if ( refMatches[1] === "heads" ) { | ||
// if branch wasn't found, use base_ref if available | ||
if ( !branch && payload.base_ref ) { | ||
branch = payload.base_ref.replace( rRef, '$2' ); | ||
} | ||
var simpler = { | ||
@@ -173,0 +179,0 @@ original: payload, |
{ | ||
"name": "gith", | ||
"description": "gith[ooks] - a simple node server that responds to github post-receive events with meaningful data", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"homepage": "https://github.com/danheberden/gith", | ||
@@ -6,0 +6,0 @@ "author": { |
# gith | ||
Version: 1.0.3 | ||
Version: 1.0.4 | ||
@@ -5,0 +5,0 @@ gith[ooks] - a simple node server that responds to github post-receive events with meaningful data |
@@ -336,4 +336,17 @@ var githFactory = require('../lib/gith.js'); | ||
gith.payload( json ); | ||
}, | ||
'tag-on-branch.json': function( test ) { | ||
var json = require( './payloads/tag-on-branch.json' ); | ||
test.expect(2); | ||
var gith = githFactory.create(); | ||
var g = gith(); | ||
g.on( 'tag:add', function( payload ) { | ||
test.equal( payload.branch, 'itsabranch', 'tagging operation should still get the branch it fired on' ); | ||
test.equal( payload.sha, '48722bc3552e5e04293a74fd3851c0c643f76657' , 'tagging operation should point to commit' ); | ||
test.done(); | ||
}); | ||
gith.payload( json ); | ||
} | ||
}; | ||
@@ -340,0 +353,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
61956
23
1849
2