1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00
Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee 2020-02-10 16:53:14 -08:00
parent a846112993
commit 2818130313
7 changed files with 48 additions and 18 deletions

View file

@ -61,13 +61,11 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
var eventName string
if len(args) > 0 {
eventName = args[0]
} else {
} else if events := planner.GetEvents(); len(events) == 1 {
// set default event type if we only have a single workflow in the file.
// this way user dont have to specify the event.
if events := planner.GetEvents(); len(events) == 1 {
log.Debugf("Using detected workflow event: %s", events[0])
eventName = events[0]
}
log.Debugf("Using detected workflow event: %s", events[0])
eventName = events[0]
}
// build the plan for this run