[llvm] [CI] Make email check workflow fail when author's email is private in Github UI (PR #148694)

Udit Kumar Agarwal via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 11:32:12 PDT 2025


https://github.com/uditagarwal97 updated https://github.com/llvm/llvm-project/pull/148694

>From 857291f5191c97a7889becc29c3a16e665f96424 Mon Sep 17 00:00:00 2001
From: "Agarwal, Udit" <udit.agarwal at intel.com>
Date: Thu, 10 Jul 2025 21:10:36 +0200
Subject: [PATCH 1/2] Fix workflow

Signed-off-by: Agarwal, Udit <udit.agarwal at intel.com>
---
 .github/workflows/email-check.yaml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/email-check.yaml b/.github/workflows/email-check.yaml
index 904ad718f97dd..35cbcd3c810eb 100644
--- a/.github/workflows/email-check.yaml
+++ b/.github/workflows/email-check.yaml
@@ -26,8 +26,11 @@ jobs:
           # Create empty comment file
           echo "[]" > comments
 
+      # If author's email is hidden in GH's settings, github.event.pull_request.user.email
+      # will be null and PR will be authored by noreply.github.com.
       - name: Validate author email
-        if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com')  }}
+        if: endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') ||
+              github.event.pull_request.user.email == ''
         env:
           COMMENT: >-
             ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
@@ -39,6 +42,9 @@ jobs:
           [{"body" : "$COMMENT"}]
           EOF
 
+          # Fail this job.
+          false
+
       - uses: actions/upload-artifact at 26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
         if: always()
         with:

>From 5aaf23af32d09fc268e3d304e385433e5ddc595a Mon Sep 17 00:00:00 2001
From: "Agarwal, Udit" <udit.agarwal at intel.com>
Date: Mon, 14 Jul 2025 20:31:51 +0200
Subject: [PATCH 2/2] add debug

---
 .github/workflows/email-check.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/.github/workflows/email-check.yaml b/.github/workflows/email-check.yaml
index 35cbcd3c810eb..1fc50a904ec32 100644
--- a/.github/workflows/email-check.yaml
+++ b/.github/workflows/email-check.yaml
@@ -42,6 +42,9 @@ jobs:
           [{"body" : "$COMMENT"}]
           EOF
 
+          echo steps.author.outputs.EMAIL
+          echo "$(github.event.pull_request.user.email)"
+
           # Fail this job.
           false
 



More information about the llvm-commits mailing list