1
1
name : " Check for private emails used in PRs"
2
2
3
3
on :
4
- pull_request_target :
4
+ pull_request :
5
5
types :
6
6
- opened
7
7
@@ -10,8 +10,6 @@ permissions:
10
10
11
11
jobs :
12
12
validate_email :
13
- permissions :
14
- pull-requests : write
15
13
runs-on : ubuntu-latest
16
14
if : github.repository == 'llvm/llvm-project'
17
15
steps :
@@ -25,20 +23,24 @@ jobs:
25
23
run : |
26
24
git log -1
27
25
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
26
+ # Create empty comment file
27
+ echo "[]" > comments
28
28
29
29
- name : Validate author email
30
30
if : ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
31
- uses : actions/github-script@v6
32
31
env :
33
- EMAIL : ${{ steps.author.outputs.EMAIL }}
32
+ COMMENT : >-
33
+ ⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
34
+ Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35
+ See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
36
+ run : |
37
+ cat << EOF > comments
38
+ [{"body" : "$COMMENT"}]
39
+ EOF
40
+
41
+ - uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
42
+ if : always()
34
43
with :
35
- script : |
36
- const { EMAIL } = process.env
37
- await github.rest.issues.createComment({
38
- issue_number: context.issue.number,
39
- owner: context.repo.owner,
40
- repo: context.repo.repo,
41
- body: `⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
42
- Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
43
- See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
44
- `})
44
+ name : workflow-args
45
+ path : |
46
+ comments
0 commit comments