Skip to content

Commit 7caa0c9

Browse files
Revert "[CI] Make email check workflow fail when author's email is private in Github UI" (#149186)
Reverts #148694 The workflow is failing if user's email is not listed publicly on your GH profile. This is different from not having your email public on Github (in Github email settings page vs. email field in Github profile/email settings).
1 parent b9f5b39 commit 7caa0c9

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

.github/workflows/email-check.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,14 @@ jobs:
2020

2121
- name: Extract author email
2222
id: author
23-
env:
24-
GH_TOKEN: ${{ github.token }}
2523
run: |
26-
# Use Github GraphQL APIs to get the email associated with the PR author because this takes into account the GitHub settings for email privacy.
27-
query='
28-
query($login: String!) {
29-
user(login: $login) {
30-
email
31-
}
32-
}'
33-
34-
PR_AUTHOR=${{ github.event.pull_request.user.login }}
35-
36-
email=$(gh api graphql -f login="$PR_AUTHOR" -f query="$query" --jq '.data.user.email')
37-
echo "EMAIL_AUTHOR_GH_UI=$email" >> "$GITHUB_OUTPUT"
38-
24+
git log -1
25+
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
3926
# Create empty comment file
4027
echo "[]" > comments
4128
42-
# When EMAIL_AUTHOR_GH_UI is NULL, author's email is hidden in GitHub UI.
43-
# In this case, we warn the user to turn off "Keep my email addresses private"
44-
# setting in their account.
4529
- name: Validate author email
46-
if: ${{ steps.author.outputs.EMAIL_AUTHOR_GH_UI == '' }}
30+
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
4731
env:
4832
COMMENT: >-
4933
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>

0 commit comments

Comments
 (0)