Merge pull request #28 from appleboy/pr

support DRONE_PULL_REQUEST env
This commit is contained in:
Bo-Yi Wu 2016-12-02 21:15:41 +08:00 committed by GitHub
commit 7c2792c82b
3 changed files with 9 additions and 2 deletions

View File

@ -6,8 +6,8 @@ services:
go: go:
- 1.5.4 - 1.5.4
- 1.6.3 - 1.6.4
- 1.7.3 - 1.7.4
- tip - tip
env: env:

View File

@ -152,6 +152,11 @@ func main() {
Usage: "build tag", Usage: "build tag",
EnvVar: "DRONE_TAG", EnvVar: "DRONE_TAG",
}, },
cli.StringFlag{
Name: "pull.request",
Usage: "pull request",
EnvVar: "DRONE_PULL_REQUEST",
},
cli.Float64Flag{ cli.Float64Flag{
Name: "job.started", Name: "job.started",
Usage: "job started", Usage: "job started",
@ -194,6 +199,7 @@ func run(c *cli.Context) error {
Link: c.String("build.link"), Link: c.String("build.link"),
Started: c.Float64("job.started"), Started: c.Float64("job.started"),
Finished: c.Float64("job.finished"), Finished: c.Float64("job.finished"),
PR: c.String("pull.request"),
}, },
Config: Config{ Config: Config{
Token: c.String("token"), Token: c.String("token"),

View File

@ -33,6 +33,7 @@ type (
Link string Link string
Started float64 Started float64
Finished float64 Finished float64
PR string
} }
// Config for the plugin. // Config for the plugin.