@@ -22,10 +22,11 @@ function getVersions()
2222/**
2323 * Get the last commit of a branch
2424 *
25+ * @param string $repo
2526 * @param string $branch
2627 * @return string
2728 */
28- function getLastCommit ($ branch )
29+ function getLastCommit ($ repo , $ branch )
2930{
3031 $ opts = [
3132 'http ' => [
@@ -38,7 +39,7 @@ function getLastCommit($branch)
3839 ];
3940 $ context = stream_context_create ($ opts );
4041
41- $ data = file_get_contents (' https://api.github.com/repos/dokuwiki/dokuwiki /commits/ ' . $ branch , false , $ context );
42+ $ data = file_get_contents (" https://api.github.com/repos/dokuwiki/ $ repo /commits/ $ branch" , false , $ context );
4243 $ json = json_decode ($ data , true );
4344 return $ json ['sha ' ];
4445}
@@ -86,13 +87,13 @@ function getImageTag()
8687
8788
8889$ result = [];
89- $ self = $ _ENV [ ' GITHUB_SHA ' ] ?? ' unknown ' ;
90+ $ self = getLastCommit ( ' docker ' , ' main ' ) ;
9091$ upstreamTag = getImageTag ();
9192$ image = getImageId ($ upstreamTag );
9293
9394foreach (getVersions () as $ release => $ info ) {
9495 $ branch = $ release === 'oldstable ' ? 'old-stable ' : $ release ;
95- $ commit = getLastCommit ($ branch );
96+ $ commit = getLastCommit (' dokuwiki ' , $ branch );
9697 $ ident = join ('- ' , [$ release , $ commit , $ image , $ self ]);
9798 $ cache = '.github/matrix.cache/ ' . $ release ;
9899
0 commit comments