Skip to content

Commit ece711f

Browse files
committed
add git config for longpaths on windows build
1 parent 8c3f984 commit ece711f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

monorepo-migration/transform_workflow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def transform(content, lib_name):
3535

3636
in_jobs = False
3737
skip_current_job = False
38+
current_job_is_windows = False
39+
3840
for line in lines:
3941
if line.startswith('name:') and not in_jobs:
4042
name_match = re.match(r'^name:\s*(.*)', line)
@@ -60,6 +62,7 @@ def transform(content, lib_name):
6062
job_match = re.match(r'^ ([\w-]+):', line)
6163
if job_match:
6264
job_name = job_match.group(1)
65+
current_job_is_windows = False # Reset for new job
6366
if job_name == 'clirr':
6467
skip_current_job = True
6568
continue
@@ -73,6 +76,15 @@ def transform(content, lib_name):
7376
continue
7477

7578
if not skip_current_job:
79+
if 'runs-on:' in line and 'windows' in line:
80+
current_job_is_windows = True
81+
82+
if line.strip() == 'steps:' and current_job_is_windows:
83+
new_lines.append(line)
84+
new_lines.append(" - name: Support longpaths")
85+
new_lines.append(" run: git config --system core.longpaths true")
86+
continue
87+
7688
if 'run: echo "SUREFIRE_JVM_OPT=' in line and '!java17' not in line:
7789
line = line.replace('" >> $GITHUB_ENV', ' -P !java17" >> $GITHUB_ENV')
7890
new_lines.append(line)

0 commit comments

Comments
 (0)