]> git.ipfire.org Git - thirdparty/git.git/commitdiff
ci: work around old records of GitHub runs
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 11 Oct 2020 21:27:10 +0000 (21:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Oct 2020 19:27:10 +0000 (12:27 -0700)
Apparently older GitHub runs at least _sometimes_ lack information about
the `head_commit` (and therefore the `ci-config` check will fail with
"TypeError: Cannot read property 'tree_id' of null") in the check added
in 7d78d5fc1a9 (ci: skip GitHub workflow runs for already-tested
commits/trees, 2020-10-08).

Let's work around this by adding a defensive condition.

Reported-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.github/workflows/main.yml

index 0a9acb6a1921855e0435a99496494fc9d7717b92..d4298878f5e370eb17a0db568959cf54d6c82f00 100644 (file)
@@ -65,7 +65,7 @@ jobs:
                 core.setOutput('enabled', ' but skip');
                 break;
               }
-              if (tree_id === run.head_commit.tree_id) {
+              if (run.head_commit && tree_id === run.head_commit.tree_id) {
                 core.warning(`Successful run for the tree ${tree_id}: ${run.html_url}`);
                 core.setOutput('enabled', ' but skip');
                 break;