[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / .github / workflows / email-check.yaml
blob8f32d020975f5d70e7eead9c34a0ea86fb836e81
1 name: "Check for private emails used in PRs"
3 on:
4   pull_request:
5     types:
6       - opened
8 permissions:
9   contents: read
11 jobs:
12   validate_email:
13     runs-on: ubuntu-latest
14     if: github.repository == 'llvm/llvm-project'
15     steps:
16       - name: Fetch LLVM sources
17         uses: actions/checkout@v4
18         with:
19           ref: ${{ github.event.pull_request.head.sha }}
21       - name: Extract author email
22         id: author
23         run: |
24           git log -1
25           echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
26           # Create empty comment file
27           echo "[]" > comments
29       - name: Validate author email
30         if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com')  }}
31         env:
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
41       - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
42         if: always()
43         with:
44           name: workflow-args
45           path: |
46             comments