Skip to content

Commit d5c3da5

Browse files
authored
Documenting CLI trigger-oriented command (#9487)
* Adding description for the CLI command * Using minimal usage example and explaining command behaviour * Being more explicit on arguments and flags * Referring to org ID * Adding information about the flag * Updating xref text * Rewording * Remove contraction and block marker
1 parent 9e12417 commit d5c3da5

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/guides/modules/toolkit/pages/how-to-use-the-circleci-local-cli.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,44 @@ The above example shows the minimal usage. You will be prompted for required val
471471
For full details on the `run` sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_pipeline_run.html[CLI docs].
472472

473473

474+
[#create-a-trigger]
475+
== Create a trigger
476+
477+
You can use the CircleCI CLI to create triggers for your projects.
478+
479+
NOTE: The `trigger` command and its `create` sub-command only apply to pipeline definitions created with the GitHub App provider (Organization slug starts with `circleci` followed by a UUID. For example, `circleci/34R3kN5RtfEE7v4sa4nWAU`. You can find your organization slug under menu:Organization Settings[Overview]).
480+
481+
For full details on creating, testing, and managing triggers for your organization, see the xref:orchestrate:triggers-overview.adoc[Trigger a pipeline] page.
482+
483+
Use the `create` sub-command to create a trigger for your project.
484+
485+
[,shell]
486+
----
487+
circleci trigger create <project-id> [flags]
488+
----
489+
490+
The above example shows the minimal usage. You will be prompted for required values if you do not intially provide them using the appropriate flags.
491+
492+
- `<project-id>` is the ID of the project associated with the trigger. You can find it from the CircleCI web app under menu:Project Settings[Overview].
493+
494+
- `--pipeline-definition-id` is the flag that allows you to provide the ID of the pipeline definition to run. If not provided, you will be prompted to enter it. You can retrieve it from the CircleCI web app by selecting btn:[Copy] for the chosen pipeline, under menu:Project settings[Pipelines].
495+
496+
- `--repo-id` is the flag that allows you to specify the ID of the GitHub repository you wish to build a pipeline definition for. It is required if the config file is in a different repository than the code repository. Refer to the link:https://docs.github.com/en/rest/repos/repos?api#get-a-repository[GitHub documentation] to find the ID.
497+
498+
- `--event-preset` is the flag that allows you to specify xref:orchestrate:github-trigger-event-options.adoc[the name of the event preset] to use when filtering events for this trigger. The value can be any of:
499+
** `all-pushes`
500+
** `only-tags`
501+
** `default-branch-pushes`
502+
** `only-build-prs`
503+
** `only-open-prs`
504+
** `only-labeled-prs`
505+
** `only-merged-prs`
506+
** `only-ready-for-review-prs`
507+
** `only-branch-delete`
508+
** `only-build-pushes-to-non-draft-prs`
509+
510+
For full details on this command and sub-command, refer to the link:https://circleci-public.github.io/circleci-cli/circleci_trigger.html[CLI docs].
511+
474512
[#context-management]
475513
== Context management
476514

0 commit comments

Comments
 (0)