Skip to content

Commit

Permalink
Merge pull request #5 from inngest/fix/update-input-args
Browse files Browse the repository at this point in the history
Update input args
  • Loading branch information
tonyhb authored Jun 6, 2022
2 parents 277d875 + 3a12e0a commit 94f6cf0
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions actionsdk/actionsdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,10 @@ var (
)

type Args struct {
ArgsVersion int
Metadata json.RawMessage
Baggage Baggage
}

type Baggage struct {
EventWrapper EventWrapper `json:"WorkspaceEvent"`
Actions map[uint]map[string]interface{}
}

type EventWrapper struct {
Event Event
Event Event `json:"event"`
Steps map[string]map[string]interface{} `json:"steps"`
Ctx map[string]interface{} `json:"ctx"`
Config json.RawMessage `json:"config"`
}

type Event struct {
Expand Down Expand Up @@ -86,14 +78,14 @@ func WriteResult(i interface{}) error {
return err
}

// GetMetadata returns the metadata for the action as configured within this specific workflow.
// GetConfig returns the config for the action as configured within this specific workflow.
// The type for this struct must match the definitions within the action config (action.cue).
func GetMetadata(dest interface{}) error {
func GetConfig(dest interface{}) error {
args, err := GetArgs()
if err != nil {
return err
}
return json.Unmarshal(args.Metadata, dest)
return json.Unmarshal(args.Config, dest)
}

// GetSecret returns the secret stored within the current workspace. If no secret is found
Expand Down

0 comments on commit 94f6cf0

Please sign in to comment.