Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1.  
  2. function check_webeditor($payload){
  3.     $githubgpgkeyid = '4AEE18F83AFDEB23';
  4.     $commits = json_decode(apisend($payload['pull_request']['commits_url']), TRUE);
  5.     $res = gnupg_init();
  6.     foreach($commits as $key=>$commit) {
  7.         if(!$commit["verfication"])
  8.             return false;
  9.         if(!signature_matches_id($commit['verification']['signature'], $githubgpgkeyid))
  10.             return false;
  11.     }
  12.     create_comment($payload, 'Pull requests made via the GitHub web editor are not accepted.');
  13.     apisend($payload['url'], 'PATCH', array('state' => 'closed'));
  14.     return true;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement