Skip to content

Commit

Permalink
[New] Display API points used and remaining after every command
Browse files Browse the repository at this point in the history
  • Loading branch information
MaheraFurniturewala authored and ljharb committed Feb 24, 2022
1 parent 03e33a9 commit bfbf166
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/can-merge
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ function outputStatus(response) {
}
});
}
console.error(`API Points: used - ${response.rateLimit.cost}\tremaining - ${response.rateLimit.remaining}`);
}
const { repo, pr, sha } = args;

Expand Down
6 changes: 6 additions & 0 deletions utils/buildQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ const pullRequestQuery = (name, owner, pr, sha) => `
}
}
}
rateLimit {
limit
cost
remaining
resetAt
}
`;

const commitStatusQuery = (name, owner, sha) => `
Expand Down

0 comments on commit bfbf166

Please sign in to comment.