Skip to content

test 3

test 3 #4

name: Check Line Endings
on:
pull_request:
paths:
- '**/*.sh'
push:
paths:
- '**/*.sh'
jobs:
check_line_endings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Find shell scripts with CRLF line endings
shell: bash
run: |
echo "🔍 Checking for CRLF endings in shell scripts..."
# Szukamy plików .sh zawierających CRLF
mapfile -t crlf_files < <(find . -type f -name "*.sh" -exec grep -Il $'\r' {} +)
if (( ${#crlf_files[@]} > 0 )); then
echo ""
echo "🚫 The following .sh files contain CRLF (Windows-style) line endings:"
for file in "${crlf_files[@]}"; do
echo " • $file"
done
echo ""
echo "💡 Please convert them to LF endings using 'dos2unix' or 'shellman line_endings'."
exit 1
else
echo "✅ All .sh files use correct LF line endings."
fi