Skip to content

Commit

Permalink
Merge pull request #18 from dbt-labs/fix/job-missing-trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
b-per authored Aug 30, 2024
2 parents de0d19c + ebdad22 commit 7950916
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/app/dbtcloud-terraforming/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ func generateResources() func(cmd *cobra.Command, args []string) {
jobTriggers := jobTyped["triggers"].(map[string]any)

triggers := map[string]any{
"github_webhook": jobTriggers["github_webhook"].(bool),
"git_provider_webhook": jobTriggers["git_provider_webhook"].(bool),
"schedule": jobTriggers["schedule"].(bool),
"on_merge": jobTriggers["on_merge"].(bool),
"github_webhook": getBool(jobTriggers["github_webhook"]),
"git_provider_webhook": getBool(jobTriggers["git_provider_webhook"]),
"schedule": getBool(jobTriggers["schedule"]),
"on_merge": getBool(jobTriggers["on_merge"]),
}

jobTyped["triggers"] = triggers
Expand Down
8 changes: 8 additions & 0 deletions internal/app/dbtcloud-terraforming/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,3 +335,11 @@ func regexFixExtendedAttributes(inp string) string {

return re.ReplaceAllStringFunc(inp, replacementFunc)
}

func getBool(value any) bool {
// Handles cases where the value is nil
if value == nil {
return false
}
return value.(bool)
}

0 comments on commit 7950916

Please sign in to comment.