File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ * .sh text eol =crlf
Original file line number Diff line number Diff line change 11name : Check Shell Script Line Endings
22
33on :
4- push :
54 pull_request :
5+ push :
66
77jobs :
88 check_crlf_in_sh :
99 name : Check for CRLF in .sh files
1010 runs-on : ubuntu-latest
1111 steps :
12- - name : Checkout code
12+ - name : Checkout code (with original line endings)
1313 uses : actions/checkout@v3
1414 with :
15- unix-newlines : false
15+ fetch-depth : 0
16+
17+ - name : Create .gitattributes to enforce LF
18+ run : |
19+ echo "*.sh text eol=lf" > .gitattributes
1620
17- - name : Scan all * .sh files for CRLF endings
21+ - name : Check for CRLF in .sh files
1822 shell : bash
1923 run : |
2024 echo "🔍 Scanning all *.sh files for CRLF endings..."
3539 echo " • $f"
3640 done
3741 echo ""
38- echo "💡 Please convert these files to LF using ' dos2unix <file>' or ' shellman line_endings --file <file> --to lf' "
42+ echo "💡 Convert them using: dos2unix <file> or shellman line_endings --file <file> --to lf"
3943 exit 1
4044 else
41- echo "✅ All .sh files use proper LF line endings."
45+ echo "✅ All .sh files use proper LF endings."
4246 fi
You can’t perform that action at this time.
0 commit comments