From f15615fb86e7a708ce169d12658d968b3ec6258c Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 11 Oct 2019 22:25:20 +0800 Subject: [PATCH] chore: add deployTo and author avatar env --- main.go | 12 ++++++++++++ plugin.go | 2 ++ 2 files changed, 14 insertions(+) diff --git a/main.go b/main.go index 5614d41..428cf79 100644 --- a/main.go +++ b/main.go @@ -143,6 +143,11 @@ func main() { Usage: "git author email", EnvVar: "DRONE_COMMIT_AUTHOR_EMAIL", }, + cli.StringFlag{ + Name: "commit.author.avatar", + Usage: "git author avatar", + EnvVar: "DRONE_COMMIT_AUTHOR_AVATAR", + }, cli.StringFlag{ Name: "commit.message", Usage: "commit message", @@ -225,6 +230,11 @@ func main() { Usage: "The GitHub workspace path. Value: /github/workspace.", EnvVar: "GITHUB_WORKSPACE", }, + cli.StringFlag{ + Name: "deploy.to", + Usage: "Provides the target deployment environment for the running build. This value is only available to promotion and rollback pipelines.", + EnvVar: "DRONE_DEPLOY_TO", + }, } if err := app.Run(os.Args); err != nil { @@ -257,6 +267,7 @@ func run(c *cli.Context) error { Link: c.String("commit.link"), Author: c.String("commit.author"), Email: c.String("commit.author.email"), + Avatar: c.String("commit.author.avatar"), Message: c.String("commit.message"), }, Build: Build{ @@ -268,6 +279,7 @@ func run(c *cli.Context) error { Started: c.Float64("job.started"), Finished: c.Float64("job.finished"), PR: c.String("pull.request"), + DeployTo: c.String("deploy.to"), }, Config: Config{ Token: c.String("token"), diff --git a/plugin.go b/plugin.go index ff39ad1..ec264de 100644 --- a/plugin.go +++ b/plugin.go @@ -36,6 +36,7 @@ type ( Branch string Link string Author string + Avatar string Email string Message string } @@ -50,6 +51,7 @@ type ( Started float64 Finished float64 PR string + DeployTo string } // Config for the plugin.