circleci trigger create

Create a new trigger for a CircleCI project.

Synopsis

Create a new trigger for a CircleCI project.

All flags are optional - if not provided, you will be prompted interactively for the required values:

–pipeline-definition-id Pipeline definition ID you wish to create a trigger for (required) –name Name of the trigger (required) –description Description of the trigger (will not prompt if omitted) –repo-id GitHub repository ID you wish to create a trigger for (required) –event-preset The name of the event preset to use when filtering events for this trigger (will not prompt if omitted) –checkout-ref Git ref (branch, or tag for example) to check out code for pipeline runs (only required if different repository, will not prompt if omitted) –config-ref Git ref (branch, or tag for example) to fetch config for pipeline runs (only required if different repository, will not prompt if omitted)

To api/v2 documentation for creating a trigger, see: https://circleci.com/docs/api/v2/index.html#tag/Trigger/operation/createTrigger

Examples: # Minimal usage (will prompt for required values): circleci trigger create 1662d941-6e28-43ab-bea2-aa678c098d4c

# Full usage with all flags: circleci trigger create 1662d941-6e28-43ab-bea2-aa678c098d4c –name my-trigger
–description “Trigger description” –repo-id 123456 –event-preset all-pushes
–config-ref my-config –checkout-ref my-checkout

Notes: - This is only supporting pipeline definitions created with GitHub App provider. You will need our GitHub App installed in your repository. - To get the repository id you can use: https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository - To get the pipeline definition id you can visit the Pipelines tab in project settings: https://app.circleci.com/settings/project/circleci///configurations - –config_ref and –checkout_ref flags are only required if your config source or checkout source exist in a different repo to your trigger repo

circleci trigger create <project-id> [--name <trigger-name>] [--description <description>] [--repo-id <github-repo-id>] [--event-preset <preset-to-filter-triggers>] [--config-ref <ref-to-fetch-config>] [--checkout-ref <ref-to-checkout-code>] [flags]

Flags

      --checkout-ref string             Git ref (branch, or tag for example) to use when checking out code for pipeline runs created from this trigger
      --config-ref string               Git ref (branch, or tag for example) to use when fetching config for pipeline runs created from this trigger
      --description string              Description of the trigger to create
      --event-preset string             The name of the event preset to use when filtering events for this trigger
  -h, --help                            help for create
      --name string                     Name of the trigger to create
      --pipeline-definition-id string   Pipeline definition ID you wish to create a trigger for
      --repo-id string                  Repository ID of the codebase you wish to create a trigger for

Flags inherited from parent commands

      --host string         URL to your CircleCI host, also CIRCLECI_CLI_HOST (default "https://circleci.com")
      --skip-update-check   Skip the check for updates check run before every command. (default true)
      --token string        your token for using CircleCI, also CIRCLECI_CLI_TOKEN

SEE ALSO