Skip to content

Commit

Permalink
Fixed more appmapping in autorun workflow with self-fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
frikky committed Aug 11, 2024
1 parent ac8103a commit 69ed759
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -23937,6 +23937,10 @@ func RunCategoryAction(resp http.ResponseWriter, request *http.Request) {
}
}

if len(value.AppId) > 0 && len(value.AppName) == 0 {
value.AppName = value.AppId
}

if len(value.AppName) == 0 {
for _, field := range value.Fields {
lowerkey := strings.ReplaceAll(strings.ToLower(field.Key), " ", "_")
Expand Down Expand Up @@ -24458,7 +24462,7 @@ func RunCategoryAction(resp http.ResponseWriter, request *http.Request) {
}

if len(foundAuthenticationId) == 0 {
log.Printf("\n\n[WARNING] Couldn't find auth for app %s\n\n", selectedApp.Name)
log.Printf("[WARNING] Couldn't find auth for app %s in org %s (%s)", selectedApp.Name, user.ActiveOrg.Name, user.ActiveOrg.Id)

requiresAuth := false
for _, action := range selectedApp.Actions {
Expand Down Expand Up @@ -24487,7 +24491,7 @@ func RunCategoryAction(resp http.ResponseWriter, request *http.Request) {
Success: false,
Action: "app_authentication",
Category: discoveredCategory,
Reason: fmt.Sprintf("Help us authenticate '%s' for you first.", selectedApp.Name),
Reason: fmt.Sprintf("Authenticate %s first.", selectedApp.Name),
Apps: []WorkflowApp{
selectedApp,
},
Expand Down
1 change: 1 addition & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3693,6 +3693,7 @@ type CategoryAction struct {

// Optional~
AppVersion string `json:"app_version"`
AppId string `json:"app_id"`
ActionName string `json:"action_name"`
Category string `json:"category"`
OptionalFields []Valuereplace `json:"optional_fields"`
Expand Down

0 comments on commit 69ed759

Please sign in to comment.