@@ -102,10 +102,20 @@ func main() {
102102 EnvVar : "LINE_PORT" ,
103103 Value : 8088 ,
104104 },
105+ cli.BoolFlag {
106+ Name : "drone" ,
107+ Usage : "environment is drone" ,
108+ EnvVar : "DRONE" ,
109+ },
110+ cli.StringFlag {
111+ Name : "repo" ,
112+ Usage : "repository owner and repository name" ,
113+ EnvVar : "DRONE_REPO,GITHUB_REPOSITORY" ,
114+ },
105115 cli.StringFlag {
106- Name : "repo.owner " ,
107- Usage : "repository owner " ,
108- EnvVar : "DRONE_REPO_OWNER" ,
116+ Name : "repo.namespace " ,
117+ Usage : "repository namespace " ,
118+ EnvVar : "DRONE_REPO_OWNER,DRONE_REPO_NAMESPACE,GITHUB_ACTOR " ,
109119 },
110120 cli.StringFlag {
111121 Name : "repo.name" ,
@@ -185,25 +195,55 @@ func main() {
185195 Usage : "pull request" ,
186196 EnvVar : "DRONE_PULL_REQUEST" ,
187197 },
188- cli.Int64Flag {
198+ cli.Float64Flag {
189199 Name : "job.started" ,
190200 Usage : "job started" ,
191201 EnvVar : "DRONE_BUILD_STARTED" ,
192202 },
193- cli.Int64Flag {
203+ cli.Float64Flag {
194204 Name : "job.finished" ,
195205 Usage : "job finished" ,
196206 EnvVar : "DRONE_BUILD_FINISHED" ,
197207 },
208+ cli.StringFlag {
209+ Name : "env-file" ,
210+ Usage : "source env file" ,
211+ },
212+ cli.BoolFlag {
213+ Name : "github" ,
214+ Usage : "Boolean value, indicates the runtime environment is GitHub Action." ,
215+ EnvVar : "PLUGIN_GITHUB,GITHUB" ,
216+ },
217+ cli.StringFlag {
218+ Name : "github.workflow" ,
219+ Usage : "The name of the workflow." ,
220+ EnvVar : "GITHUB_WORKFLOW" ,
221+ },
222+ cli.StringFlag {
223+ Name : "github.action" ,
224+ Usage : "The name of the action." ,
225+ EnvVar : "GITHUB_ACTION" ,
226+ },
227+ cli.StringFlag {
228+ Name : "github.event.name" ,
229+ Usage : "The webhook name of the event that triggered the workflow." ,
230+ EnvVar : "GITHUB_EVENT_NAME" ,
231+ },
232+ cli.StringFlag {
233+ Name : "github.event.path" ,
234+ Usage : "The path to a file that contains the payload of the event that triggered the workflow. Value: /github/workflow/event.json." ,
235+ EnvVar : "GITHUB_EVENT_PATH" ,
236+ },
237+ cli.StringFlag {
238+ Name : "github.workspace" ,
239+ Usage : "The GitHub workspace path. Value: /github/workspace." ,
240+ EnvVar : "GITHUB_WORKSPACE" ,
241+ },
198242 cli.StringFlag {
199243 Name : "deploy.to" ,
200244 Usage : "Provides the target deployment environment for the running build. This value is only available to promotion and rollback pipelines." ,
201245 EnvVar : "DRONE_DEPLOY_TO" ,
202246 },
203- cli.StringFlag {
204- Name : "env-file" ,
205- Usage : "source env file" ,
206- },
207247 cli.BoolFlag {
208248 Name : "tunnel" ,
209249 Usage : "Enable tunnel host for webhook" ,
@@ -275,9 +315,17 @@ func run(c *cli.Context) error {
275315 }
276316
277317 plugin := Plugin {
318+ GitHub : GitHub {
319+ Workflow : c .String ("github.workflow" ),
320+ Workspace : c .String ("github.workspace" ),
321+ Action : c .String ("github.action" ),
322+ EventName : c .String ("github.event.name" ),
323+ EventPath : c .String ("github.event.path" ),
324+ },
278325 Repo : Repo {
279- Owner : c .String ("repo.owner" ),
280- Name : c .String ("repo.name" ),
326+ FullName : c .String ("repo" ),
327+ Namespace : c .String ("repo.namespace" ),
328+ Name : c .String ("repo.name" ),
281329 },
282330 Commit : Commit {
283331 Sha : c .String ("commit.sha" ),
@@ -295,8 +343,8 @@ func run(c *cli.Context) error {
295343 Event : c .String ("build.event" ),
296344 Status : c .String ("build.status" ),
297345 Link : c .String ("build.link" ),
298- Started : c .Int64 ("job.started" ),
299- Finished : c .Int64 ("job.finished" ),
346+ Started : c .Float64 ("job.started" ),
347+ Finished : c .Float64 ("job.finished" ),
300348 PR : c .String ("pull.request" ),
301349 DeployTo : c .String ("deploy.to" ),
302350 },
0 commit comments