Skip to content

Commit 0c065fa

Browse files
committed
Sort out windows CRLF mess
1 parent 1b8f0ff commit 0c065fa

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/pr-checks.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
timeout-minutes: 45
2727

2828
steps:
29+
- name: Prepare git (Windows)
30+
if: runner.os == 'Windows'
31+
run: git config --global core.autocrlf false
32+
2933
- uses: actions/checkout@v5
3034

3135
- name: Set up Node.js

pr-checks/sync.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def writeHeader(checkStream):
240240
})
241241

242242
raw_file = this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml.raw"
243-
with open(raw_file, 'w') as output_stream:
243+
with open(raw_file, 'w', newline='\n') as output_stream:
244244
writeHeader(output_stream)
245245
yaml.dump({
246246
'name': f"PR Check - {checkSpecification['name']}",
@@ -274,7 +274,7 @@ def writeHeader(checkStream):
274274
}, output_stream)
275275

276276
with open(raw_file, 'r') as input_stream:
277-
with open(this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml", 'w') as output_stream:
277+
with open(this_dir.parent / ".github" / "workflows" / f"__{checkName}.yml", 'w', newline='\n') as output_stream:
278278
content = input_stream.read()
279279
output_stream.write("\n".join(list(map(lambda x:x.rstrip(), content.splitlines()))+['']))
280280
os.remove(raw_file)
@@ -328,7 +328,7 @@ def writeHeader(checkStream):
328328
}, output_stream)
329329

330330
with open(raw_file, 'r') as input_stream:
331-
with open(this_dir.parent / ".github" / "workflows" / f"__{collection_name}.yml", 'w') as output_stream:
331+
with open(this_dir.parent / ".github" / "workflows" / f"__{collection_name}.yml", 'w', newline='\n') as output_stream:
332332
content = input_stream.read()
333333
output_stream.write("\n".join(list(map(lambda x:x.rstrip(), content.splitlines()))+['']))
334334
os.remove(raw_file)

pr-checks/sync.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
cd "$(dirname "$0")"
55
python3 -m venv env
6-
source env/bin/activate
6+
source env/*/activate
77
pip3 install ruamel.yaml==0.17.31
88
python3 sync.py
99

0 commit comments

Comments
 (0)