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

Action fails when the file has just LF/CRLF diffs on windows #1202

Closed
HaoboGu opened this issue Jul 23, 2022 · 8 comments · Fixed by #1211
Closed

Action fails when the file has just LF/CRLF diffs on windows #1202

HaoboGu opened this issue Jul 23, 2022 · 8 comments · Fixed by #1211

Comments

@HaoboGu
Copy link

HaoboGu commented Jul 23, 2022

Subject of the issue

I use create-pull-request to create pr after build the bindings on different platforms. On windows, the built bindings uses CRLF, but when they are committed to repo, CRLF will be replaced by LF, results in "nothing to commit" error and the action fails then

Steps to reproduce

See this action run: https://github.com/HaoboGu/ors/runs/7482028978?check_suite_focus=true#step:7:67

@peter-evans
Copy link
Owner

Hi @HaoboGu

Is the problem that CRLF will be replaced by LF? Is that what you want to prevent?
If so, it looks like you can disable that in git config. You could try disabling it in a step before the action runs.
https://stackoverflow.com/a/17628353/11934042

@HaoboGu
Copy link
Author

HaoboGu commented Jul 29, 2022

@peter-evans I want CRLFs replaced by LF in my repo, so I don't want to disable that git config.

The problematic file is auto-generated on Windows so git recognizes it's different from the file in the repo. But due to the replacement config of git, there is nothing to commit, which leads to this error.

I expect that the action could just ignore this kind of error.

@kzu
Copy link

kzu commented Aug 11, 2022

Same issue here: https://github.com/devlooped/sponsors/runs/7789936995?check_suite_focus=true.

This should totally be ignored by the action.

kzu added a commit to devlooped/sponsors that referenced this issue Aug 11, 2022
Due to the CRLLF/LF issue, the workflow is otherwise failing on run.

See peter-evans/create-pull-request#1202
kzu added a commit to devlooped/sponsors that referenced this issue Aug 11, 2022
Whenever the sponsors.md changes, the include in the readme should also be changed. Rather than waiting for a second PR to be created for that, merge both actions in a single workflow.

We don't need the includes workflow anymore, therefore.

Force run on workflow

Due to the CRLLF/LF issue, the workflow is otherwise failing on run.

See peter-evans/create-pull-request#1202
@peter-evans
Copy link
Owner

@HaoboGu @kzu I've made a fix for this issue here: #1211

I had trouble trying to reproduce this behaviour in an integration test and eventually gave up. So it would be great if you could test this version of the action and let me know if it fixes the issue for you.

You can test the new version like this:

      - uses: peter-evans/create-pull-request@win-crlf-fix

@HaoboGu
Copy link
Author

HaoboGu commented Aug 18, 2022

Verified.

action run: https://github.com/HaoboGu/ors/actions/runs/2880445434

@peter-evans
Copy link
Owner

@HaoboGu Thank you for testing! I will get this released.

@peter-evans
Copy link
Owner

Released as v4.1.1 / v4.

@HaoboGu Please let me know when you have reverted the version back to v4 so I can remove the win-crlf-fix testing branch.

@HaoboGu
Copy link
Author

HaoboGu commented Aug 18, 2022

@peter-evans everything goes well, thanks for the work!

devpow112 pushed a commit to devpow112/docker-base-ubuntu that referenced this issue Aug 19, 2022
Bumps peter-evans/create-pull-request from 4.1.0 to 4.1.1.

Release notes
Sourced from peter-evans/create-pull-request's releases.

Create Pull Request v4.1.1
⚙️ Fixes an issue that occurred on Windows runners when CRLF is auto-replaced by LF by Git. peter-evans/create-pull-request#1202
What's Changed

fix: handle nothing to commit when autocrlf is set by @​peter-evans in peter-evans/create-pull-request#1211
Update distribution by @​github-actions in peter-evans/create-pull-request#1216

Full Changelog: peter-evans/create-pull-request@v4.1.0...v4.1.1



Commits

18f9043 build: update distribution (#1216)
2721abb fix: handle nothing to commit when autocrlf is set (#1211)
See full diff in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

3 participants