Skip to content

Commit 04eec61

Browse files
Merge branch 'master' into unbox_value_or-hstring
2 parents 65d059b + d254f72 commit 04eec61

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Check Line Endings
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
check-line-endings:
11+
name: Enforce .gitattributes line endings
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
- name: Check for line ending violations
17+
run: |
18+
# Re-normalize all files according to .gitattributes
19+
git add --renormalize .
20+
21+
# Check if renormalization changed anything
22+
if git diff --cached --name-only | grep -q .; then
23+
echo "::error::The following files have line endings that don't match .gitattributes settings:"
24+
git diff --cached --name-only
25+
echo ""
26+
echo "To fix, run:"
27+
echo " git add --renormalize ."
28+
echo " git commit -m 'Normalize line endings'"
29+
exit 1
30+
fi
31+
32+
echo "All files have correct line endings."

0 commit comments

Comments
 (0)