[llvm] [CI] Make premerge jobs support GHA postcommit (PR #176180)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 15 07:25:02 PST 2026


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/176180

This was causing failures in the release branch as the premerge jobs there are also run postcommit through GHA. We were expecting a PR number to always be present when it was not.

>From 7f3c7d6fea860c880f6265f58e942e0322864ace Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Thu, 15 Jan 2026 15:23:14 +0000
Subject: [PATCH] [CI] Make premerge jobs support GHA postcommit

This was causing failures in the release branch as the premerge jobs
there are also run postcommit through GHA. We were expecting a PR number
to always be present when it was not.
---
 .ci/utils.sh | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/.ci/utils.sh b/.ci/utils.sh
index 923c64a4e169c..f14fe753415ce 100644
--- a/.ci/utils.sh
+++ b/.ci/utils.sh
@@ -37,11 +37,15 @@ function at-exit {
     python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
       $retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
       >> $GITHUB_STEP_SUMMARY
-    (python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
-      $(git rev-parse HEAD~1) $retcode "${GITHUB_TOKEN}" \
-      $GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
-      "${MONOREPO_ROOT}"/ninja*.log)
-    advisor_retcode=$?
+    if [[ -n "$GITHUB_PR_NUMBER" ]]; then
+      (python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
+        $(git rev-parse HEAD~1) $retcode "${GITHUB_TOKEN}" \
+        $GITHUB_PR_NUMBER "${BUILD_DIR}"/test-results.*.xml \
+        "${MONOREPO_ROOT}"/ninja*.log)
+      advisor_retcode=$?
+    else
+      advisor_retcode=$retcode
+    fi
   fi
 
   if [[ "$retcode" != "0" ]]; then



More information about the llvm-commits mailing list