Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atlasaction: fixed schema-name input on actions #238

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading