mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-15 19:17:14 +02:00
chore(runner): add new register command
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
15
cmd/root.go
15
cmd/root.go
@ -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)
|
||||
|
Reference in New Issue
Block a user