# Git Merge

`PATCH /workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions/:action_id`

Update Git Merge action configuration

**Required Scopes:** `EXECUTION_MANAGE`

## URL Parameters

```typescript
interface URLParameters {
  /** The human-readable ID of the workspace */
  workspace: string; // Example: "my-company"
  /** The human-readable ID of the project */
  project_name: string; // Example: "my-project"
  /** The ID of the pipeline */
  pipeline_id: number; // Example: 123
  /** The ID of the action */
  action_id: number; // Example: 456
}
```

## Body Parameters

```typescript
interface BodyParameters {
  /** The type of the action */
  type: "GIT_MERGE";
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The numerical ID of the action, after which this action should be added */
  after_action_id?: number;
  /** The name of the action */
  name: string;
  /** Specifies when the action should be executed */
  trigger_time?: "ON_EVERY_EXECUTION" | "ON_SUCCESS" | "ON_FAILURE" | "ON_BACK_TO_SUCCESS" | "ON_WARNING" | "ON_WAIT_FOR_APPROVE" | "ON_TERMINATE";
  /** The list of trigger conditions to meet so that the action can be triggered */
  trigger_conditions?: TriggerConditionView[];
  /** Defines whether the action should run in parallel with the next one */
  run_next?: "WAIT_ON_SUCCESS" | "IN_SOFT_PARALLEL" | "IN_HARD_PARALLEL";
  /** Defines whether the action should be executed on each failure. Restricted to and required if the `trigger_time` is `ON_FAILURE` */
  run_only_on_first_failure?: boolean;
  /** The list of variables you can use the action */
  variables?: EnvironmentVariableView[];
  /** When set to `true` the action is disabled. By default it is set to `false` */
  disabled?: boolean;
  /** The timeout in seconds */
  timeout?: number;
  /** If set to `true` the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions */
  ignore_errors?: boolean;
  /** Number of retries if the action fails */
  retry_count?: number;
  /** Delay time between auto retries in seconds */
  retry_interval?: number;
  /** The list of commands that will be executed in a loop */
  loop?: string[];
  /** The git revision of the last successful run of the action */
  current_revision?: string;
  /** Access permissions configuration */
  permissions?: PermissionsView;
  /** The source branch to merge into the current branch */
  branch: string;
  /** The strategy for handling merge conflicts: `FAIL` (default), `OURS`, or `THEIRS` */
  conflict_strategy?: "FAIL" | "OURS" | "THEIRS";
  /** Set to `true` to only check if the merge is possible without actually performing it */
  dry_run?: boolean;
  /** Set to `true` to always create a merge commit even if a fast-forward merge is possible */
  no_fast_forward?: boolean;
  /** The email address of the committer used in the merge commit */
  commiter_email?: string;
  /** The custom commit message for the merge commit */
  commit_message?: string;
}
```

## Response Body

```typescript
interface ResponseBody {
  /** The type of the action */
  type?: "GIT_MERGE";
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The ID of the action */
  id?: number;
  /** The name of the action */
  name?: string;
  /** The git revision of the last successful run of the action */
  current_revision?: string;
  /** Specifies when the action should be executed */
  trigger_time?: "ON_EVERY_EXECUTION" | "ON_SUCCESS" | "ON_FAILURE" | "ON_BACK_TO_SUCCESS" | "ON_WARNING" | "ON_WAIT_FOR_APPROVE" | "ON_TERMINATE";
  /** The list of trigger conditions to meet so that the action can be triggered */
  trigger_conditions?: TriggerConditionView[];
  /** Defines whether the action should run in parallel with the next one */
  run_next?: "WAIT_ON_SUCCESS" | "IN_SOFT_PARALLEL" | "IN_HARD_PARALLEL";
  /** Defines whether the action should be executed on each failure. Restricted to and required if the `trigger_time` is `ON_FAILURE` */
  run_only_on_first_failure?: boolean;
  /** The list of variables you can use the action */
  variables?: EnvironmentVariableView[];
  /** When set to `true` the action is disabled. By default it is set to `false` */
  disabled?: boolean;
  /** The timeout in seconds */
  timeout?: number;
  /** If set to `true` the execution will proceed, mark action as a warning and jump to the next action. Doesn't apply to deployment actions */
  ignore_errors?: boolean;
  /** Number of retries if the action fails */
  retry_count?: number;
  /** Delay time between auto retries in seconds */
  retry_interval?: number;
  /** The status of the last run of the action */
  last_execution_status?: "INPROGRESS" | "ENQUEUED" | "TERMINATED" | "SUCCESSFUL" | "FAILED" | "INITIAL" | "NOT_EXECUTED" | "SKIPPED" | "TERMINATING" | "WAITING_FOR_APPLY" | "WAITING_FOR_VARIABLES" | "WAITING_FOR_SETTABLE_VARIABLES" | "WAITING_FOR_VT_SESSION";
  /** Short representation of a pipeline */
  pipeline?: ShortPipelineView;
  /** Access permissions configuration */
  permissions?: PermissionsView;
  /** The list of commands that will be executed in a loop */
  loop?: string[];
  /** The source branch to merge into the current branch */
  branch?: string;
  /** The strategy for handling merge conflicts: `FAIL` (default), `OURS`, or `THEIRS` */
  conflict_strategy?: "FAIL" | "OURS" | "THEIRS";
  /** Set to `true` to only check if the merge is possible without actually performing it */
  dry_run?: boolean;
  /** Set to `true` to always create a merge commit even if a fast-forward merge is possible */
  no_fast_forward?: boolean;
  /** The email address of the committer used in the merge commit */
  commiter_email?: string;
  /** The custom commit message for the merge commit */
  commit_message?: string;
}
```

## Type Definitions

```typescript
interface TriggerConditionView {
  /** The type of trigger condition */
  trigger_condition?: "ALWAYS" | "ON_CHANGE" | "ON_CHANGE_AT_PATH" | "VAR_IS" | "VAR_IS_NOT" | "VAR_CONTAINS" | "VAR_NOT_CONTAINS" | "DATETIME" | "SUCCESS_PIPELINE" | "DAY" | "HOUR" | "OR" | "VAR_LESS_THAN" | "VAR_LESS_THAN_OR_EQUAL" | "VAR_GREATER_THAN" | "VAR_GREATER_THAN_OR_EQUAL" | "ACTION_STATUS_IS" | "ACTION_STATUS_IS_NOT" | "TRIGGERING_USER_IS" | "TRIGGERING_USER_IS_NOT" | "TRIGGERING_USER_IS_IN_GROUP" | "TRIGGERING_USER_IS_NOT_IN_GROUP";
  /** The value to compare the trigger variable against */
  trigger_variable_value?: string;
  /** The name of the variable to check in the trigger condition */
  trigger_variable_key?: string;
  /** The timezone for datetime trigger conditions (e.g., 'UTC', 'Europe/Warsaw') */
  timezone?: string;
  /** The hours when the datetime trigger should activate (0-23) */
  trigger_hours?: number[];
  /** The days when the datetime trigger should activate (1-7, where 1 is Monday) */
  trigger_days?: number[];
  /** The project name for cross-project pipeline triggers */
  trigger_project_name?: string;
  /** The pipeline name for cross-pipeline triggers */
  trigger_pipeline_name?: string;
  /** The email of the user who can trigger the pipeline */
  trigger_user?: string;
  /** The name of the group that can trigger the pipeline */
  trigger_group?: string;
  /** The file paths that must change to trigger the pipeline */
  trigger_condition_paths?: string[];
  /** The action status to check for action status triggers */
  trigger_status?: "SUCCESSFUL" | "FAILED" | "SKIPPED" | "SUPPRESSED";
  /** The name of the action to check status for */
  trigger_action_name?: string;
  /** The list of nested trigger conditions for OR/AND operators */
  trigger_operands?: TriggerConditionOperandView[];
}

interface TriggerConditionOperandView {
  /** The type of trigger condition */
  trigger_condition?: "ALWAYS" | "ON_CHANGE" | "ON_CHANGE_AT_PATH" | "VAR_IS" | "VAR_IS_NOT" | "VAR_CONTAINS" | "VAR_NOT_CONTAINS" | "DATETIME" | "SUCCESS_PIPELINE" | "DAY" | "HOUR" | "OR" | "VAR_LESS_THAN" | "VAR_LESS_THAN_OR_EQUAL" | "VAR_GREATER_THAN" | "VAR_GREATER_THAN_OR_EQUAL" | "ACTION_STATUS_IS" | "ACTION_STATUS_IS_NOT" | "TRIGGERING_USER_IS" | "TRIGGERING_USER_IS_NOT" | "TRIGGERING_USER_IS_IN_GROUP" | "TRIGGERING_USER_IS_NOT_IN_GROUP";
  /** The value to compare the trigger variable against */
  trigger_variable_value?: string;
  /** The name of the variable to check in the trigger condition */
  trigger_variable_key?: string;
  /** The timezone for datetime trigger conditions (e.g., 'UTC', 'Europe/Warsaw') */
  timezone?: string;
  /** The hours when the datetime trigger should activate (0-23) */
  trigger_hours?: number[];
  /** The days when the datetime trigger should activate (1-7, where 1 is Monday) */
  trigger_days?: number[];
  /** The project name for cross-project pipeline triggers */
  trigger_project_name?: string;
  /** The pipeline name for cross-pipeline triggers */
  trigger_pipeline_name?: string;
  /** The email of the user who can trigger the pipeline */
  trigger_user?: string;
  /** The name of the group that can trigger the pipeline */
  trigger_group?: string;
  /** The file paths that must change to trigger the pipeline */
  trigger_condition_paths?: string[];
  /** The action status to check for action status triggers */
  trigger_status?: "SUCCESSFUL" | "FAILED" | "SKIPPED" | "SUPPRESSED";
  /** The name of the action to check status for */
  trigger_action_name?: string;
}

interface EnvironmentVariableView {
  /** The ID of the variable */
  id?: number;
  /** The name of the variable */
  key?: string;
  /** The value of the variable */
  value?: string;
  /** The type of the added variable */
  type?: "VAR" | "FILE" | "SSH_KEY" | "IOS_KEYCHAIN" | "IOS_PROVISION_PROFILES" | "SSH_PUBLIC_KEY" | "GPG_KEY";
  /** If set to `true` the variable value will be encrypted and hidden */
  encrypted?: boolean;
  /** If set to `true` the variable value can be set by Buddy actions */
  settable?: boolean;
  /** Available only if `type=VAR`. If set to `true` the variable value can be set by Buddy actions only for execution time */
  run_only_settable?: boolean;
  /** The optional description of the variable */
  description?: string;
  /** Initial path for the variable */
  init_path?: string;
  /** Default value for the variable */
  defaults?: string;
  /** Specifies where to copy the file on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES` */
  file_path?: string;
  /** File permission set on copy to a container on each run. Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES` */
  file_chmod?: string;
  /** Set if `type` is `FILE`, `SSH_KEY`, `SSH_PUBLIC_KEY`, `IOS_KEYCHAIN`, or `IOS_PROVISION_PROFILES`. If it's `NONE`, the variable can be used as a parameter in an action. For `CONTAINER`, the given key is additionally copied to an action container on each run */
  file_place?: "NONE" | "CONTAINER";
  /** Whether the file is binary */
  binary?: boolean;
  /** Public value for SSH key type variables */
  public_value?: string;
  /** Fingerprint of SSH key */
  key_fingerprint?: string;
  /** Checksum of the variable value */
  checksum?: string;
  /** Password for certificates */
  password?: string;
  /** Passphrase for encrypted SSH keys */
  passphrase?: string;
  /** Key identifier for iOS certificates, provisioning profiles, or GPG keys */
  key_identifier?: string;
}

interface PermissionsView {
  /** Access level for other workspace members */
  others?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
  /** List of specific users with their access levels */
  users?: UserPermissionView[];
  /** List of user groups with their access levels */
  groups?: GroupPermissionView[];
}

interface UserPermissionView {
  /** The ID of the user */
  id?: number;
  /** The access level for the user */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface GroupPermissionView {
  /** The ID of the group */
  id?: number;
  /** The access level for the group */
  access_level?: "DENIED" | "READ_ONLY" | "USE_ONLY" | "BLIND" | "RUN_ONLY" | "READ_WRITE" | "MANAGE" | "DEFAULT" | "ALLOWED" | "STAGE" | "COMMIT";
}

interface ShortPipelineView {
  /** API endpoint to GET this object */
  url?: string;
  /** Web URL to view this object in Buddy.works */
  html_url?: string;
  /** The unique identifier of the pipeline */
  id?: number;
  /** A human-readable ID of pipeline */
  identifier?: string;
  /** The name of the pipeline */
  name?: string;
  /** The source of the pipeline definition */
  definition_source?: "LOCAL" | "REMOTE";
  /** The git configuration reference type */
  git_config_ref?: "NONE" | "DYNAMIC" | "FIXED";
  /** Pipeline git context refs. If unset and events is empty, the pipeline counts as codeless */
  refs?: string[];
  /** The list of events that trigger the pipeline run */
  events?: PipelineEventView[];
  /** The loop configuration for the pipeline */
  loop?: string[];
  /** The priority of the pipeline */
  priority?: "LOW" | "NORMAL" | "HIGH";
  /** Indicates if the pipeline is disabled */
  disabled?: boolean;
  /** The reason why the pipeline is disabled */
  disabled_reason?: string;
  /** The status of the last run */
  last_execution_status?: "INPROGRESS" | "ENQUEUED" | "TERMINATED" | "SUCCESSFUL" | "FAILED" | "INITIAL" | "NOT_EXECUTED" | "SKIPPED" | "TERMINATING" | "WAITING_FOR_APPLY" | "WAITING_FOR_VARIABLES" | "WAITING_FOR_SETTABLE_VARIABLES" | "WAITING_FOR_VT_SESSION";
  /** The git revision of the last run */
  last_execution_revision?: string;
  /** The URL to the target site after deployment */
  target_site_url?: string;
  /** The template for commit status messages */
  execution_message_template?: string;
  /** The creation date of the pipeline */
  create_date?: string;
  /** Defines whether to upload everything from scratch on every run */
  always_from_scratch?: boolean;
  /** If set to true, the status of a given pipeline will not impact the project status on the dashboard */
  ignore_fail_on_project_status?: boolean;
  /** If set to true, the pipeline will not skip queued runs to execute the most recent one */
  no_skip_to_most_recent?: boolean;
  /** If set to true, stale runs will be automatically terminated */
  terminate_stale_runs?: boolean;
  /** Defines whether to automatically clear cache before running the pipeline */
  auto_clear_cache?: boolean;
  /** Indicates if the pipeline is paused */
  paused?: boolean;
  /** Defines how many repeated failures are required to pause the pipeline */
  pause_on_repeated_failures?: number;
  /** If set to true, all refs will be fetched from the repository */
  fetch_all_refs?: boolean;
  /** If set to true, LFS files will be fetched from the external repository during pipeline runs */
  fetch_lfs?: boolean;
  /** If set to true, the pipeline will fail on environment preparation warnings */
  fail_on_prepare_env_warning?: boolean;
  /** Defines whether the pipeline can be run concurrently */
  concurrent_pipeline_runs?: boolean;
  /** Defines the depth of the git clone operation for shallow clones */
  clone_depth?: number;
  /** If set to true, commit statuses will not be created in the repository */
  do_not_create_commit_status?: boolean;
  /** Indicates that pipeline definition was probably removed on particular Git ref and pipeline won't be run on events */
  stale?: boolean;
  /** Indicates if the pipeline is waiting for the first push to the repository */
  waiting_for_push?: boolean;
  /** The resource configuration for the pipeline run */
  resources?: "DEFAULT" | "NANO" | "SMALL" | "MEDIUM" | "LARGE" | "XLARGE" | "CUSTOM" | "X2LARGE";
  /** The path to the remote pipeline definition file */
  remote_path?: string;
  /** The ref of the remote pipeline definition */
  remote_ref?: string;
  /** The project name of the remote pipeline definition */
  remote_project_name?: string;
  /** The parameters passed to the remote pipeline definition */
  remote_parameters?: PipelinePropertyView[];
  /** YAML pipeline definition configuration */
  git_config?: YamlDefinitionView;
  /** The list of tags associated with the pipeline for organization */
  tags?: string[];
  /** The base for git changeset calculation. Determines which changes trigger the pipeline */
  git_changeset_base?: "LATEST_RUN" | "LATEST_RUN_MATCHING_REF" | "PULL_REQUEST";
  /** The base for filesystem changeset calculation. Determines which file changes trigger the pipeline */
  filesystem_changeset_base?: "DATE_MODIFIED" | "CONTENTS";
  /** The CPU architecture for the pipeline run */
  cpu?: "X64" | "ARM" | "X86";
  /** If set to true, a description is required when executing the pipeline manually */
  description_required?: boolean;
  /** The folder name where the pipeline is organized */
  folder?: string;
}

interface PipelineEventView {
  /** The type of event that triggers the pipeline */
  type?: "PUSH" | "CREATE_REF" | "DELETE_REF" | "PULL_REQUEST" | "SCHEDULE" | "PUBLISH_ARTIFACT_VERSION" | "DELETE_ARTIFACT_VERSION" | "WEBHOOK" | "EMAIL" | "CREATE_ARTIFACT_VERSION" | "ENVIRONMENT_CREATE" | "ENVIRONMENT_DELETE";
  /** The list of refs (branches/tags) that trigger the pipeline for push/ref events */
  refs?: string[];
  /** The list of pull request events that trigger the pipeline. Examples: `OPENED`, `EDITED`, `CLOSED`, `LABELED`, `UNLABELED`, `REVIEW_REQUESTED`, `REVIEW_REQUESTED_REMOVED`, `SYNCHRONIZED` */
  events?: string[];
  /** The list of branches for pull request events */
  branches?: string[];
  /** The list of artifacts that trigger the pipeline */
  artifacts?: PipelineArtifactContextView[];
  /** The list of environments that trigger the pipeline */
  environments?: PipelineEnvironmentContextView[];
  /** The start date for scheduled events (type `SCHEDULE`) */
  start_date?: string;
  /** The delay in minutes between scheduled runs (type `SCHEDULE`) */
  delay?: number;
  /** The cron expression for scheduled (type `SCHEDULE`) events e.g., '0 9 * * 1-5' for weekdays at 9 AM */
  cron?: string;
  /** The timezone for scheduled events (type `SCHEDULE`) e.g., 'UTC', 'Europe/Warsaw' */
  timezone?: string;
  /** Whether TOTP (Time-based One-Time Password) is enabled for webhook events (type `WEBHOOK`) */
  totp?: boolean;
  /** The email subject prefix for email trigger events (type `EMAIL`) */
  prefix?: string;
  /** The list of allowed email addresses that can trigger the pipeline via email (type `EMAIL`) */
  whitelist?: string[];
}

interface PipelineArtifactContextView {
  /** A human-readable ID of artifact */
  identifier?: string;
  /** The scope of the artifact */
  scope?: "WORKSPACE" | "PROJECT" | "ENVIRONMENT" | "ANY";
}

interface PipelineEnvironmentContextView {
  /** A human-readable ID of the environment. Alphanumeric characters, underscores, and hyphens (hyphens cannot appear at the start or end). */
  identifier?: string;
  /** The list of tags associated with the environment */
  tags?: string[];
  /** The scope of the environment */
  scope?: "PROJECT" | "WORKSPACE" | "ANY";
}

interface PipelinePropertyView {
  /** The key of the pipeline property */
  key?: string;
  /** The value of the pipeline property */
  value?: string;
}

interface YamlDefinitionView {
  /** The file path to the YAML definition */
  path?: string;
  /** The git ref (branch/tag) where the YAML definition is located */
  branch?: string;
  /** The project name where the YAML definition is located */
  project?: string;
}

```

## Request Example

```bash
curl -X PATCH "https://api.buddy.works/workspaces/:workspace/projects/:project_name/pipelines/:pipeline_id/actions/:action_id" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Merge develop into main",
  "type": "GIT_MERGE",
  "trigger_time": "ON_EVERY_EXECUTION",
  "branch": "develop",
  "conflict_strategy": "FAIL",
  "dry_run": false,
  "no_fast_forward": true
}'
```

## Response Example

**Status:** `200 OK`


---
Original source: https://buddy.works/docs/api/actions/edit/git-merge