Skip to content

Commit

Permalink
fix: dont validate langs
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-crumbaugh committed Apr 10, 2024
1 parent 3935cfd commit 2d1299d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions internal/actions/runWorkflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func RunWorkflow() error {
return err
}

wf, workflowPath, err := configuration.GetWorkflowAndValidateLanguages(true)
wf, workflowPath, err := configuration.GetWorkflowAndValidateLanguages(false)
if err != nil {
return err
}
Expand All @@ -33,7 +33,7 @@ func RunWorkflow() error {
return err
}

return runWorkflow(g, resolvedVersion, wf)
return runWorkflow(g, resolvedVersion)
}

pinnedVersion := wf.SpeakeasyVersion.String()
Expand All @@ -53,7 +53,7 @@ func RunWorkflow() error {
logging.Info("Attempting auto-upgrade from Speakeasy version %s to %s", pinnedVersion, resolvedVersion)
}

err = runWorkflow(g, resolvedVersion, wf)
err = runWorkflow(g, resolvedVersion)
if attemptingAutoUpgrade {
// If we tried to upgrade and the run succeeded, update the workflow file with the new version
if err == nil {
Expand All @@ -73,14 +73,19 @@ func RunWorkflow() error {
return err
}

return runWorkflow(g, resolvedVersion, wf)
return runWorkflow(g, resolvedVersion)
}
}

return err
}

func runWorkflow(g *git.Git, resolvedVersion string, wf *workflow.Workflow) error {
func runWorkflow(g *git.Git, resolvedVersion string) error {
wf, _, err := configuration.GetWorkflowAndValidateLanguages(true)
if err != nil {
return err
}

minimumVersionForRun := version.Must(version.NewVersion("1.161.0"))
if !cli.IsAtLeastVersion(minimumVersionForRun) {
return fmt.Errorf("action requires at least version %s of the speakeasy CLI", minimumVersionForRun)
Expand All @@ -99,7 +104,7 @@ func runWorkflow(g *git.Git, resolvedVersion string, wf *workflow.Workflow) erro
}
}

branchName, err := g.FindOrCreateBranch(branchName, environment.ActionRunWorkflow)
branchName, err = g.FindOrCreateBranch(branchName, environment.ActionRunWorkflow)
if err != nil {
return err
}
Expand Down

0 comments on commit 2d1299d

Please sign in to comment.