[MIRROR] Add whitelist to webhook processor PR tagging [MDB IGNORE] (#21749)

* Add whitelist to webhook processor PR tagging (#75943)

I hate this script. Actions my beloved...

This is to get it away from my beautiful tgstation-server garden.

Fixes https://github.com/tgstation/tgstation-server/issues/1520

* Add whitelist to webhook processor PR tagging

---------

Co-authored-by: Jordan Dominion <Cyberboss@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-06-15 16:06:34 +02:00
committed by GitHub
parent 43027ba9ea
commit 95c477f49d
2 changed files with 11 additions and 2 deletions

View File

@@ -28,7 +28,8 @@ define('F_SECRET_PR', 1<<1);
$hookSecret = '08ajh0qj93209qj90jfq932j32r';
$apiKey = '209ab8d879c0f987d06a09b9d879c0f987d06a09b9d8787d0a089c';
$repoOwnerAndName = "tgstation/tgstation";
$repoOwnerAndName = "tgstation/tgstation"; // this is just the repository auto-updates happen from
$repoAutoTaggerWhitelist = array("tgstation", "TerraGov-Marine-Corps");
$servers = array();
$enable_live_tracking = true;
$path_to_script = 'tools/WebhookProcessor/github_webhook_processor.php';
@@ -212,6 +213,11 @@ function check_tag_and_replace($payload, $title_tag, $label, &$array_to_add_labe
}
function set_labels($payload, $labels, $remove) {
global $repoAutoTaggerWhitelist;
if(!in_array($repoAutoTaggerWhitelist, $payload['repository']['name'])) {
return;
}
$existing = get_labels($payload);
$tags = array();