| 527 | } |
| 528 | |
| 529 | func TestRunFix_DisabledCodemodSkipsMatchingFix(t *testing.T) { |
| 530 | tmpDir := t.TempDir() |
| 531 | workflowFile := filepath.Join(tmpDir, "test.md") |
| 532 | |
| 533 | content := `--- |
| 534 | on: workflow_dispatch |
| 535 | timeout_minutes: 30 |
| 536 | --- |
| 537 | # Test Workflow |
| 538 | ` |
| 539 | require.NoError(t, os.WriteFile(workflowFile, []byte(content), 0644)) |
| 540 | |
| 541 | err := RunFix(FixConfig{ |
| 542 | Write: true, |
| 543 | WorkflowDir: tmpDir, |
| 544 | DisabledCodemodIDs: []string{"timeout-minutes-migration"}, |
| 545 | }) |
| 546 | require.NoError(t, err) |
| 547 | |
| 548 | updatedContent, err := os.ReadFile(workflowFile) |
| 549 | require.NoError(t, err) |
| 550 | assert.Contains(t, string(updatedContent), "timeout_minutes: 30") |
| 551 | assert.NotContains(t, string(updatedContent), "timeout-minutes: 30") |
| 552 | } |
| 553 | |
| 554 | func TestFixCommand_CommandToSlashCommandMigration(t *testing.T) { |
| 555 | // Create a temporary directory for test files |