Disable legacy workflows by renaming them.
(self)
| 318 | return False |
| 319 | |
| 320 | def _disable_legacy_workflows(self) -> bool: |
| 321 | """Disable legacy workflows by renaming them.""" |
| 322 | try: |
| 323 | legacy_files = ["ci.yml", "release.yml"] |
| 324 | disabled_files = [] |
| 325 | |
| 326 | for legacy_file in legacy_files: |
| 327 | legacy_path = self.workflows_dir / legacy_file |
| 328 | |
| 329 | if legacy_path.exists(): |
| 330 | disabled_path = self.workflows_dir / f"{legacy_file}.disabled" |
| 331 | |
| 332 | if not self.dry_run: |
| 333 | legacy_path.rename(disabled_path) |
| 334 | |
| 335 | disabled_files.append(legacy_file) |
| 336 | print(f" [DISABLE] {legacy_file} -> {disabled_path.name}") |
| 337 | |
| 338 | if not disabled_files: |
| 339 | print(" [INFO] No legacy workflow files found to disable") |
| 340 | |
| 341 | return True |
| 342 | |
| 343 | except Exception as e: |
| 344 | self.steps[5].error = str(e) |
| 345 | return False |
| 346 | |
| 347 | def _cleanup_migration(self) -> bool: |
| 348 | """Clean up migration artifacts (optional step).""" |