Skip to content

Commit

Permalink
feat: add default event meta (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-oksaku authored Sep 30, 2022
1 parent 3c3ef72 commit d017692
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 26 deletions.
10 changes: 10 additions & 0 deletions launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,16 @@ func launch(api screwdriver.API, buildID int, rootDir, emitterPath, metaSpace, s
mergedMeta["build"] = buildMeta
}

eventMeta := map[string]interface{}{
"creator": event.Creator["username"],
}

if mergedMeta["event"] != nil {
mergedMeta["event"] = deepMergeJSON(mergedMeta["event"].(map[string]interface{}), eventMeta)
} else {
mergedMeta["event"] = eventMeta
}

log.Println("Marshalling Merged Meta JSON")
metaByte, err = marshal(mergedMeta)

Expand Down
Loading

0 comments on commit d017692

Please sign in to comment.