mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Caches the github diff for has_tree_been_edited (#30578)
This commit is contained in:
committed by
CitadelStationBot
parent
eeadba6f18
commit
5b0d8c9470
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user