mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 03:06:34 +00:00

This patch replaces all instances of ubuntu-latest with ubuntu-24.04 (outside of the entries in libc++) based on the guidelines in the LLVM CI best practices doc (https://llvm.org/docs/CIBestPractices.html).
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: "Check for private emails used in PRs"
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate_email:
|
|
runs-on: ubuntu-24.04
|
|
if: github.repository == 'llvm/llvm-project'
|
|
steps:
|
|
- name: Fetch LLVM sources
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Extract author email
|
|
id: author
|
|
run: |
|
|
git log -1
|
|
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
|
|
# Create empty comment file
|
|
echo "[]" > comments
|
|
|
|
- name: Validate author email
|
|
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
|
|
env:
|
|
COMMENT: >-
|
|
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
|
|
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
|
|
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
|
|
run: |
|
|
cat << EOF > comments
|
|
[{"body" : "$COMMENT"}]
|
|
EOF
|
|
|
|
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
|
|
if: always()
|
|
with:
|
|
name: workflow-args
|
|
path: |
|
|
comments
|