From 4b6a9e252d2d99067ec95b2e09fdd67e99abed95 Mon Sep 17 00:00:00 2001 From: Christian Weichel Date: Wed, 23 Jun 2021 20:05:16 +0000 Subject: [PATCH] [github-integration] Add werft help command --- plugins/github-integration/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/github-integration/main.go b/plugins/github-integration/main.go index f7b3454..247a474 100644 --- a/plugins/github-integration/main.go +++ b/plugins/github-integration/main.go @@ -24,6 +24,13 @@ var ( annotationStatusUpdate = "updateGitHubStatus" defaultGitHubHost = "github.com" + + commandHelp = `You can interact with werft using: ` + "`" + `/werft command ` + "`" + `. +Available commands are: + - ` + "`" + `/werft run [annotation=value]` + "`" + ` which starts a new werft job from this context. + You can optionally pass multiple whitespace-separated annotations. + - ` + "`" + `/werft help` + "`" + ` displays this help +` ) // Config configures this plugin @@ -420,8 +427,10 @@ func (p *githubTriggerPlugin) processIssueCommentEvent(ctx context.Context, even switch cmd { case "run": resp, err = p.handleCommandRun(ctx, event, pr, args) + case "help": + resp = commandHelp default: - err = fmt.Errorf("unknown command: %s", cmd) + err = fmt.Errorf("unknown command: %s\nUse `/werft help` to list the available commands", cmd) } if err != nil { log.WithError(err).Warn("GitHub webhook error")