2019-12-26 20:26:27 +01:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
2022-12-08 20:16:40 +01:00
|
|
|
$commit = getenv('GITHUB_SHA');
|
|
|
|
$branch = trim(shell_exec("git rev-parse --abbrev-ref HEAD"));
|
|
|
|
$tag = trim(shell_exec("git tag --points-at HEAD"));
|
2021-03-30 21:18:38 +02:00
|
|
|
|
2021-03-30 21:20:36 +02:00
|
|
|
echo "Waiting for commit $commit on branch $branch (tag $tag)...".PHP_EOL;
|
|
|
|
|
2022-12-08 20:16:40 +01:00
|
|
|
if (substr($tag, -5) === '.9999' || substr($tag, -5) === '.9998') {
|
2021-09-04 17:37:48 +02:00
|
|
|
die;
|
|
|
|
}
|
|
|
|
|
2021-03-30 21:18:38 +02:00
|
|
|
$branch = $tag ? $tag : "dev-$branch";
|
2019-12-28 01:02:50 +01:00
|
|
|
|
2021-04-06 22:18:03 +02:00
|
|
|
$cur = 0;
|
2019-12-26 20:26:27 +01:00
|
|
|
while (true) {
|
2022-12-08 20:16:40 +01:00
|
|
|
$json = json_decode(file_get_contents("https://repo.packagist.org/p/danog/madelineproto.json?v=$cur"), true);
|
2021-03-30 21:18:38 +02:00
|
|
|
if ($json["packages"]["danog/madelineproto"][$branch]["source"]["reference"] === $commit) {
|
2019-12-26 20:26:27 +01:00
|
|
|
return;
|
|
|
|
}
|
2022-12-08 20:16:40 +01:00
|
|
|
sleep(1);
|
2021-04-06 22:18:03 +02:00
|
|
|
$cur++;
|
2019-12-26 20:26:27 +01:00
|
|
|
}
|