Skip to content

Commit cb26100

Browse files
committed
docs: update docs a bit
1 parent f713cd2 commit cb26100

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

README.md

+38-2
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,53 @@ NAME:
156156
scm-engine evaluate - Evaluate a Merge Request
157157
158158
USAGE:
159-
scm-engine evaluate [command options]
159+
scm-engine evaluate [command options] [id, id, ...]
160160
161161
OPTIONS:
162+
--project value GitLab project (example: 'gitlab-org/gitlab') [$GITLAB_PROJECT, $CI_PROJECT_PATH]
162163
--id value, --merge-request-id value, --pull-request-id value The pull/merge to process, if not provided as a CLI flag [$CI_MERGE_REQUEST_IID]
164+
--help, -h show help
163165
164166
GLOBAL OPTIONS:
165167
--config value Path to the scm-engine config file (default: ".scm-engine.yml") [$SCM_ENGINE_CONFIG_FILE]
166168
--api-token value GitHub/GitLab API token [$SCM_ENGINE_TOKEN]
167-
--project value GitLab project (example: 'gitlab-org/gitlab') [$GITLAB_PROJECT, $CI_PROJECT_PATH]
168169
--base-url value Base URL for the SCM instance (default: "https://gitlab.com/") [$GITLAB_BASEURL, $CI_SERVER_URL]
170+
--dry-run Dry run, don't actually _do_ actions, just print them (default: false)
169171
--help, -h show help
172+
--version, -v print the version
173+
```
174+
175+
### `server`
176+
177+
Point your GitLab webhook at the `/gitlab` endpoint.
178+
179+
Support the following events, and they will both trigger an Merge Request `evaluation`
180+
181+
- [`Comments`](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#comment-events) - A comment is made or edited on an issue or merge request.
182+
- [`Merge request events`](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#merge-request-events) - A merge request is created, updated, or merged.
183+
184+
> [!TIP]
185+
> You have access to the raw webhook event payload via `webhook_event.*` fields in Expr script fields when using `server` mode. See the [GitLab Webhook Events documentation](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html) for available fields.
186+
187+
```plain
188+
NAME:
189+
scm-engine server - Start HTTP server for webhook event driven usage
190+
191+
USAGE:
192+
scm-engine server [command options]
193+
194+
OPTIONS:
195+
--webhook-secret value Used to validate received payloads. Sent with the request in the X-Gitlab-Token HTTP header [$SCM_ENGINE_WEBHOOK_SECRET]
196+
--listen value Port the HTTP server should listen on (default: "0.0.0.0:3000") [$SCM_ENGINE_LISTEN]
197+
--help, -h show help
198+
199+
GLOBAL OPTIONS:
200+
--config value Path to the scm-engine config file (default: ".scm-engine.yml") [$SCM_ENGINE_CONFIG_FILE]
201+
--api-token value GitHub/GitLab API token [$SCM_ENGINE_TOKEN]
202+
--base-url value Base URL for the SCM instance (default: "https://gitlab.com/") [$GITLAB_BASEURL, $CI_SERVER_URL]
203+
--dry-run Dry run, don't actually _do_ actions, just print them (default: false)
204+
--help, -h show help
205+
--version, -v print the version
170206
```
171207

172208
## Configuration file

cmd/conventions.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ const (
77
FlagMergeRequestID = "id"
88
FlagSCMBaseURL = "base-url"
99
FlagSCMProject = "project"
10-
FlagServerListen = "listen-port"
10+
FlagServerListen = "listen"
1111
FlagWebhookSecret = "webhook-secret"
1212
)

main.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ func main() {
7676
},
7777
Commands: []*cli.Command{
7878
{
79-
Name: "evaluate",
80-
Usage: "Evaluate a Merge Request",
81-
Action: cmd.Evaluate,
79+
Name: "evaluate",
80+
Usage: "Evaluate a Merge Request",
81+
Args: true,
82+
ArgsUsage: " [id, id, ...]",
83+
Action: cmd.Evaluate,
8284
Flags: []cli.Flag{
8385
&cli.StringFlag{
8486
Name: cmd.FlagSCMProject,

0 commit comments

Comments
 (0)