mirror of
https://github.com/sebastianbergmann/docker-amiga-gcc.git
synced 2026-05-05 03:49:33 +00:00
Detect changes in https://github.com/bebbo/gcc repository
This commit is contained in:
17
bump.php
17
bump.php
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
$tmp = file_get_contents(__DIR__ . '/Dockerfile');
|
$tmp = file_get_contents(__DIR__ . '/Dockerfile');
|
||||||
$old = substr($tmp, strpos($tmp, 'git checkout -qf ') + strlen('git checkout -qf '), 40);
|
$old = substr($tmp, strpos($tmp, 'git checkout -qf ') + strlen('git checkout -qf '), 40);
|
||||||
$new = trim(`git ls-remote https://github.com/bebbo/amiga-gcc.git | grep HEAD | awk '{ print $1}'`);
|
$new = trim(`git ls-remote https://github.com/bebbo/amiga-gcc.git | grep HEAD | awk '{ print $1}'`);
|
||||||
@@ -9,3 +9,18 @@ file_put_contents(
|
|||||||
str_replace($old, $new, $tmp)
|
str_replace($old, $new, $tmp)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$old = '';
|
||||||
|
|
||||||
|
if (file_exists(__DIR__ . '/gcc-latest-commit')) {
|
||||||
|
$old = trim(file_get_contents(__DIR__ . '/gcc-latest-commit'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$new = trim(`git ls-remote https://github.com/bebbo/gcc.git | grep HEAD | awk '{ print $1}'`);
|
||||||
|
|
||||||
|
if ($old !== $new) {
|
||||||
|
print 'https://github.com/bebbo/gcc.git has new commits' . PHP_EOL;
|
||||||
|
|
||||||
|
file_put_contents(__DIR__ . '/gcc-latest-commit', $new);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
gcc-latest-commit
Normal file
1
gcc-latest-commit
Normal file
@@ -0,0 +1 @@
|
|||||||
|
9d6d884a23533914abf895793ece26a6e92505d6
|
||||||
Reference in New Issue
Block a user