-
Notifications
You must be signed in to change notification settings - Fork 15
28 lines (24 loc) · 1.01 KB
/
check_line_endings.yml
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
# Validate that there are no files in the repo with invalid line endings
# Files in the repo should contain LF
# The git checkout will transform them to CRLF (configured in the .gitattributes file)
# see https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
name: CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for changes on a fresh checkout
run: |
if [[ -n $(git status --porcelain) ]]; then
git status
echo "Found changes in a fresh checkout, probably files have been checked in with invalid line endings. See https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings#refreshing-a-repository-after-changing-line-endings"
exit 1
fi