chore(runner): add new register command

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-10-15 16:12:32 +08:00
committed by Jason Song
parent cce60d466b
commit a503f7429f
9 changed files with 128 additions and 42 deletions

View File

@ -52,12 +52,21 @@ func Execute(ctx context.Context) {
// ./act_runner daemon
daemonCmd := &cobra.Command{
Aliases: []string{"daemon"},
Use: "daemon [event name to run]\nIf no event name passed, will default to \"on: push\"",
Short: "Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly.",
Use: "execute runner daemon",
Args: cobra.MaximumNArgs(1),
RunE: runDaemon(ctx, task),
}
rootCmd.AddCommand(daemonCmd)
// ./act_runner daemon
registerCmd := &cobra.Command{
Aliases: []string{"register"},
Use: "register new runner",
Args: cobra.MaximumNArgs(1),
RunE: runRegister(ctx, task),
}
// add all command
rootCmd.AddCommand(daemonCmd, registerCmd)
if err := rootCmd.Execute(); err != nil {
os.Exit(1)