Skip to content

gi-org-pl/check-crlf-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

check-crlf-action

A GitHub Action that fails if any tracked files in the repository contain CRLF line endings.

Usage

- name: Check for CRLF line endings
  uses: gi-org-pl/check-crlf-action@v1
  with:
    base-ref: ${{ github.base_ref }}

Inputs

Input Description Required Default
base-ref Base branch to compare against No main

Example workflow

name: PR Sanity Checks

on:
  pull_request:

jobs:
  check:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Check for CRLF line endings
        uses: gi-org-pl/check-crlf-action@v1
        with:
          base-ref: ${{ github.base_ref }}

How it works

The action scans all tracked files using git ls-files --eol and fails the workflow if any file contains CRLF (\r\n) line endings. This helps enforce consistent LF line endings across the codebase.

To fix CRLF files locally, add the following to your .gitattributes:

* text=auto eol=lf

Then re-normalize with:

git add --renormalize .
git commit -m "chore: normalize line endings to LF"

Authors

Action author is Oskar Barcz, CTO of Generacja Innowacja — Poland's first technology-first NGO.

License

MIT

About

A GitHub Action that fails if any tracked files in the repository contain CRLF line endings.

Resources

License

Stars

Watchers

Forks

Contributors

Languages