Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function check_webeditor($payload){
- $githubgpgkeyid = '4AEE18F83AFDEB23';
- $commits = json_decode(apisend($payload['pull_request']['commits_url']), TRUE);
- $res = gnupg_init();
- foreach($commits as $key=>$commit) {
- if(!$commit["verfication"])
- return false;
- if(!signature_matches_id($commit['verification']['signature'], $githubgpgkeyid))
- return false;
- }
- create_comment($payload, 'Pull requests made via the GitHub web editor are not accepted.');
- apisend($payload['url'], 'PATCH', array('state' => 'closed'));
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement