git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] ci: work around old records of GitHub runs

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 11, 2020, 21:27 UTC
Message-ID
<6c0ba7ec05a41c38176571d675cc9d1ff298ecc5.1602451631.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.748.git.1602451631.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 .github/workflows/main.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 0a9acb6a19..d4298878f5 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -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;
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 2 of 5 in “ci: make the new GitHub workflow logic more defensive”
  1. 0/2 ci: make the new GitHub workflow logic more defensiveJohannes Schindelin via GitGitGadget, Oct 11, 2020
  2. 1/2 ci: work around old records of GitHub runsJohannes Schindelin via GitGitGadget, Oct 11, 2020
  3. 2/2 ci: make the "skip-if-redundant" check more defensiveJohannes Schindelin via GitGitGadget, Oct 11, 2020
  4. Junio C HamanoOct 12, 2020
  5. Junio C HamanoOct 12, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.