Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add autocrlf option for Windows #226

Open
jeroen opened this issue Apr 25, 2020 · 7 comments
Open

Add autocrlf option for Windows #226

jeroen opened this issue Apr 25, 2020 · 7 comments

Comments

@jeroen
Copy link

jeroen commented Apr 25, 2020

I'm frequently debugging issues on my Windows builds which are due to the default git behavior of automatically changing line endings upon checkout. This default behavior sort-of makes sense for Windows users to edit text files in editors, but for CI it's really unfortunate.

It would be really nice to have a native option to disable autocrlf, and checkout the repo as-is.

Currently I use this as a workaround (before running this action):

    steps:
      - name: Prepare git
        run: git config --global core.autocrlf false

      - uses: actions/checkout@v2

But it would be nice if I could tell all the users of my action that they can just use:

- uses: actions/checkout@v2
  with: 
    autocrlf: false

Thanks!

@ericsciple
Copy link
Contributor

@jeroen have you considered setting the desired value for the repo, in the the .gitattributes file?

@matthijskooijman
Copy link

I also just ran into this, resulting in modified line endings in a generated source tarball.

have you considered setting the desired value for the repo, in the the .gitattributes file?

As @jeroen already mentioned, line translation can be useful for Windows users and their editors, so disabling it repository-wide might not be ideal. In this sense you just want consistent behaviour across the CI platforms, so specifying it at the CI-level makes sense to me.

@umarcor
Copy link

umarcor commented Jun 4, 2020

Coming from #250, this is an issue if git from MSYS2 is used. In my use cases, I found core.autocrlf input to fix it. Hence, having a crlf option in this action would be really helpful.

@gtirloni
Copy link

gtirloni commented Jul 2, 2020

I just ran into this issue today. We don't want to use gitattributes because it imposes a way of working that developers might not like. And it's really only happening on Windows CI machines.

@umarcor
Copy link

umarcor commented Jul 2, 2020

@gtirloni you might find the workaround in https://github.com/msys2/setup-msys2#usage to be useful.

mifi added a commit to mifi/lossless-cut that referenced this issue Apr 5, 2021
@jkroepke
Copy link

jkroepke commented Jun 4, 2021

If you repository contains submodules, git config --global core.eol lf is required, too.

    steps:
      - name: Prepare git
        run: |-
          git config --global core.autocrlf false
          git config --global core.eol lf

      - uses: actions/checkout@v2

@kriegaex
Copy link

This seems to be a duplicate or at least closely related to #135. I am going to comment on the older issue.

tkluck added a commit to tkluck/StatProfilerHTML.jl that referenced this issue May 25, 2022
This workaround was suggested by jeroen in actions/checkout#226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants