File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,18 +71,10 @@ func getEnvironment(Environment []string) map[string]string {
7171 return output
7272}
7373
74- func (p Plugin ) loadEnvironment (envs []string ) (* lambda.Environment , error ) {
75- m := aws .StringMap (getEnvironment (envs ))
76- if p .Commit .Sha != "" {
77- m ["DRONE_COMMIT" ] = & p .Commit .Sha
78- }
79- if p .Commit .Author != "" {
80- m ["DRONE_AUTHOR" ] = & p .Commit .Author
81- }
82-
74+ func (p Plugin ) loadEnvironment (envs []string ) * lambda.Environment {
8375 return & lambda.Environment {
84- Variables : m ,
85- }, nil
76+ Variables : aws . StringMap ( getEnvironment ( envs )) ,
77+ }
8678}
8779
8880// Exec executes the plugin.
@@ -204,13 +196,8 @@ func (p Plugin) Exec() error {
204196
205197 envs := trimValues (p .Config .Environment )
206198 if len (envs ) > 0 {
207- // load environment
208- env , err := p .loadEnvironment (envs )
209- if err != nil {
210- return err
211- }
212199 isUpdateConfig = true
213- cfg .SetEnvironment (env )
200+ cfg .SetEnvironment (p . loadEnvironment ( envs ) )
214201 }
215202
216203 subnets := trimValues (p .Config .Subnets )
You can’t perform that action at this time.
0 commit comments