-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.32 KB
/
Copy pathpr-checks.yml
File metadata and controls
50 lines (39 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: PR Checks
on:
pull_request:
branches: [develop, main]
permissions:
contents: read
jobs:
ai-coauthor-check:
name: AI Co-Author Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for AI Co-Authored-By trailers
run: |
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
AI_PATTERNS="(claude|anthropic|copilot|github-actions|openai|chatgpt|cursor|noreply@anthropic|noreply@github)"
MATCHES=$(git log --format="%H %B" "$BASE_SHA".."$HEAD_SHA" | grep -iE "co-authored-by:.*${AI_PATTERNS}" || true)
if [ -n "$MATCHES" ]; then
echo "::error::Found AI Co-Authored-By trailers in commits. Please remove them before merging."
echo ""
echo "Matches found:"
echo "$MATCHES"
echo ""
echo "To fix: use 'git rebase -i' to edit the commits and remove the Co-Authored-By lines."
exit 1
fi
echo "No AI Co-Authored-By trailers found."
build:
name: Build
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Build
run: swift build
- name: Build release
run: swift build -c release