Skip to content

Commit de44a95

Browse files
authored
Merge pull request #479 from depot/andrea/reorder-migrate-cmd-output
chore: migrate cmd - reverse order of next steps when secrets detected
2 parents 042fbb3 + 8963b45 commit de44a95

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

pkg/cmd/ci/migrate.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,16 +640,22 @@ func workflows(opts migrateOptions) error {
640640

641641
fmt.Fprintln(out, "")
642642
fmt.Fprintf(out, "%s\n\n", bold.Render("Next steps:"))
643-
if defaultBranch != "" {
644-
fmt.Fprintf(out, " 1. Activate these workflows by pushing and merging them into %s\n", bold.Render(defaultBranch))
645-
} else {
646-
fmt.Fprintln(out, " 1. Activate these workflows by pushing and merging them into your default branch")
647-
}
648643

649644
if len(detectedSecrets) > 0 || len(detectedVariables) > 0 {
650-
fmt.Fprintf(out, " 2. Your workflows depend on %d secret(s) and %d variable(s) which need to be imported from GitHub:\n", len(detectedSecrets), len(detectedVariables))
645+
fmt.Fprintf(out, " 1. Your workflows depend on %d secret(s) and %d variable(s) which need to be imported from GitHub:\n", len(detectedSecrets), len(detectedVariables))
651646
fmt.Fprintln(out, " - Import them automatically with `depot ci migrate secrets-and-vars`")
652647
fmt.Fprintln(out, " - Or import them manually with `depot ci secrets add` and `depot ci vars add`")
648+
if defaultBranch != "" {
649+
fmt.Fprintf(out, " 2. Activate these workflows by pushing and merging them into %s\n", bold.Render(defaultBranch))
650+
} else {
651+
fmt.Fprintln(out, " 2. Activate these workflows by pushing and merging them into your default branch")
652+
}
653+
} else {
654+
if defaultBranch != "" {
655+
fmt.Fprintf(out, " Activate these workflows by pushing and merging them into %s\n", bold.Render(defaultBranch))
656+
} else {
657+
fmt.Fprintln(out, " Activate these workflows by pushing and merging them into your default branch")
658+
}
653659
}
654660

655661
fmt.Fprintln(out, "")

0 commit comments

Comments
 (0)