Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gitbot

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbot - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

24

lib/git/git-service.js

@@ -54,2 +54,3 @@ 'use strict';

internals.getOpenPullRequestForSpecificBranch = (github, repo_owner, repo_name, branch_name) => {
const head = `${ repo_owner }:refs/heads/${ branch_name }`;
return new _promise2.default((resolve, reject) => {

@@ -60,3 +61,3 @@ github.pullRequests.getAll({

state: 'open',
head: branch_name
head: head
}, (err, res) => {

@@ -68,11 +69,20 @@ if (err) {

if (res && Array.isArray(res) && res.length > 0) {
resolve(res[0]);
if (!res || !Array.isArray(res) || res.length === 0) {
reject(createError({
code: 404,
message: `No open pull request found for this branch: ${ branch_name }`
}));
return;
}
reject(createError({
code: 404,
message: `No open pull request found for this branch: ${ branch_name }`
}));
const filtered_pull_request = res.find(item => item.head.ref === branch_name);
if (!filtered_pull_request) {
reject(createError({
code: 404,
message: `Could not find the pull request for branch: ${ branch_name }`
}));
return;
}
resolve(filtered_pull_request);
});

@@ -79,0 +89,0 @@ });

@@ -64,3 +64,3 @@ {

},
"version": "2.0.1"
"version": "2.0.2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc