File tree Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Expand file tree Collapse file tree 1 file changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -21,30 +21,14 @@ jobs:
21
21
22
22
- name : Extract author email
23
23
id : author
24
- env :
25
- GH_TOKEN : ${{ github.token }}
26
24
run : |
27
- # Use Github GraphQL APIs to get the email associated with the PR author because this takes into account the GitHub settings for email privacy.
28
- query='
29
- query($login: String!) {
30
- user(login: $login) {
31
- email
32
- }
33
- }'
34
-
35
- PR_AUTHOR=${{ github.event.pull_request.user.login }}
36
-
37
- email=$(gh api graphql -f login="$PR_AUTHOR" -f query="$query" --jq '.data.user.email')
38
- echo "EMAIL_AUTHOR_GH_UI=$email" >> "$GITHUB_OUTPUT"
39
-
25
+ git log -1
26
+ echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
40
27
# Create empty comment file
41
28
echo "[]" > comments
42
29
43
- # When EMAIL_AUTHOR_GH_UI is NULL, author's email is hidden in GitHub UI.
44
- # In this case, we warn the user to turn off "Keep my email addresses private"
45
- # setting in their account.
46
30
- name : Validate author email
47
- if : ${{ steps.author.outputs.EMAIL_AUTHOR_GH_UI == '' }}
31
+ if : ${{ endsWith( steps.author.outputs.EMAIL, 'noreply.github.com') }}
48
32
env :
49
33
COMMENT : >-
50
34
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
55
39
[{"body" : "$COMMENT"}]
56
40
EOF
57
41
58
- # Fail this job.
59
- false
60
-
61
42
- uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
62
43
if : always()
63
44
with :
You can’t perform that action at this time.
0 commit comments