ci: fix CRLF line endings in shell scripts#46
Open
rivetphilbot wants to merge 2 commits into
Open
Conversation
The 'Cleanup PR Body' workflow fails on every PR because cleanup_pr_body.sh is committed with CRLF line endings. On the Linux Actions runner bash reads the trailing \r as part of each command: cleanup_pr_body.sh: line 2: $'\r': command not found cleanup_pr_body.sh: line 3: set: - : invalid option cleanup_pr_body.sh: line 51: syntax error: unexpected end of file Convert the script to LF so it runs on the runner.
build.sh, cuda-install.sh, env.sh and pytorch-install.sh were committed with CRLF line endings, so they fail the same way as cleanup_pr_body.sh when their workflows run on a Linux runner (bash reads $'\r' as part of each command). Add a .gitattributes (*.sh text eol=lf) so shell scripts are stored with LF going forward and the issue does not regress.
philbert440
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Cleanup PR Bodyworkflow (update-description) fails on every PR..github/scripts/cleanup_pr_body.shis committed with CRLF line endings, and on the Linux Actions runner bash interprets the trailing\ras part of each command:The same CRLF issue affects the four
.github/workflows/scripts/scripts (build.sh,cuda-install.sh,env.sh,pytorch-install.sh), which fail identically when their workflows run on a Linux runner.Fix
cleanup_pr_body.shand the four.github/workflows/scripts/scripts to LF. The whole-file diffs are purely the line-ending change —bash -npasses on all five after conversion..gitattributes(*.sh text eol=lf) so shell scripts are stored with LF going forward and the issue does not regress.Note on scope
This PR is scoped to the five CI-critical scripts. For full context: all 89 tracked
.shfiles in the repo are currently CRLF (.buildkite/,examples/,tools/, etc.). The.gitattributesadded here declares the LF intent repo-wide but does not rewrite the other 84 files — a one-shotgit add --renormalize .would do that cleanly if you want it, but that is a maintainer call and kept out of this PR to keep the diff reviewable.