diff --git a/tools/WebhookProcessor/github_webhook_processor.php b/tools/WebhookProcessor/github_webhook_processor.php index 0ee66acabf..dde21e4f43 100644 --- a/tools/WebhookProcessor/github_webhook_processor.php +++ b/tools/WebhookProcessor/github_webhook_processor.php @@ -358,13 +358,18 @@ function auto_update($payload){ fclose($code_file); } +$github_diff = null; + function has_tree_been_edited($payload, $tree){ - //go to the diff url - $url = $payload['pull_request']['diff_url']; - $content = file_get_contents($url); + global $github_diff; + if ($github_diff === null) { + //go to the diff url + $url = $payload['pull_request']['diff_url']; + $github_diff = file_get_contents($url); + } //find things in the _maps/map_files tree //e.g. diff --git a/_maps/map_files/Cerestation/cerestation.dmm b/_maps/map_files/Cerestation/cerestation.dmm - return $content !== FALSE && strpos($content, 'diff --git a/' . $tree) !== FALSE; + return $github_diff !== FALSE && strpos($github_diff, 'diff --git a/' . $tree) !== FALSE; } function checkchangelog($payload, $merge = false, $compile = true) {