Skip to content

Commit

Permalink
atlasaction: fixed schema-name input on actions (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Sep 23, 2024
1 parent 6909019 commit aab6dd4
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions atlasaction/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func (a *Actions) SchemaPush(ctx context.Context) error {
return err
}
params := &atlasexec.SchemaPushParams{
Repo: a.GetInput("schema-name"),
Repo: a.GetAtlasURLInput("schema-name"),
Description: a.GetInput("description"),
Version: a.GetInput("version"),
DevURL: a.GetInput("dev-url"),
Expand Down Expand Up @@ -509,7 +509,7 @@ func (a *Actions) SchemaPlan(ctx context.Context) error {
Env: a.GetInput("env"),
Vars: a.GetVarsInput("vars"),
Context: a.GetRunContext(ctx, tc),
Repo: a.GetInput("schema-name"),
Repo: a.GetAtlasURLInput("schema-name"),
DevURL: a.GetInput("dev-url"),
From: a.GetArrayInput("from"),
To: a.GetArrayInput("to"),
Expand Down Expand Up @@ -620,7 +620,7 @@ func (a *Actions) SchemaPlanApprove(ctx context.Context) error {
Env: params.Env,
Vars: params.Vars,
Context: a.GetRunContext(ctx, tc),
Repo: a.GetInput("schema-name"),
Repo: a.GetAtlasURLInput("schema-name"),
DevURL: a.GetInput("dev-url"),
From: a.GetArrayInput("from"),
To: a.GetArrayInput("to"),
Expand Down Expand Up @@ -741,6 +741,15 @@ func (a *Actions) GetDurationInput(name string) time.Duration {
return 0
}

// GetAtlasURLInput returns the atlas URL input with the given name.
func (a *Actions) GetAtlasURLInput(name string) string {
v := a.GetInput(name)
if v == "" {
return ""
}
return (&url.URL{Scheme: "atlas", Path: v}).String()
}

// GetVarsInput returns the vars input with the given name.
// The input should be a JSON string.
// Example:
Expand Down

0 comments on commit aab6dd4

Please sign in to comment.