BUG: Try collecting memberships queries into a single Promise [ci skip]
username: context.payload.sender.login,
});
console.log(`Finished requests for ${context.payload.sender.login}`);
- return membership.then(
- (result) => {
+ return Promise.all([membership, core_membership]).then(
+ (results) => {
+ for (const result of results){
if (result.status == 200 && result.data.state == 'active'){
return true;
- } else {
- console.log(result);
- return false;
}
- },
- (error) => {
- return core_membership.then(
- (result) => {
- if (result.status == 200 && result.data.state == 'active'){
- return true;
- } else {
- console.log(result);
- return false;
}
- },
- (error) => {
+ console.log(results);
return false;
}
);
- }
- );
- name: add-labels
if: >
