## UpdateTask `environments.automations.tasks.update(TaskUpdateParams**kwargs) -> object` **post** `/gitpod.v1.EnvironmentAutomationService/UpdateTask` Updates an automation task configuration. Use this method to: - Modify task commands - Update task triggers - Change dependencies - Adjust execution settings ### Examples - Update command: Changes the task's command. ```yaml id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" spec: command: "npm run test:coverage" ``` - Update triggers: Modifies when the task runs. ```yaml id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" metadata: triggeredBy: trigger: - postEnvironmentStart: true ``` ### Parameters - `id: Optional[str]` - `depends_on: Optional[Sequence[str]]` dependencies specifies the IDs of the automations this task depends on. - `metadata: Optional[Metadata]` - `description: Optional[str]` - `name: Optional[str]` - `triggered_by: Optional[MetadataTriggeredBy]` - `trigger: Optional[Iterable[AutomationTrigger]]` - `before_snapshot: Optional[bool]` - `manual: Optional[bool]` - `post_devcontainer_start: Optional[bool]` - `post_environment_start: Optional[bool]` - `post_machine_start: Optional[bool]` - `prebuild: Optional[bool]` - `spec: Optional[Spec]` - `command: Optional[str]` - `env: Optional[Iterable[EnvironmentVariableItem]]` - `name: Optional[str]` name is the environment variable name. - `value: Optional[str]` value is a literal string value. - `value_from: Optional[EnvironmentVariableSource]` value_from specifies a source for the value. - `secret_ref: SecretRef` secret_ref references a secret by ID. - `id: Optional[str]` id is the UUID of the secret to reference. - `prebuild_requires_success: Optional[bool]` - `runs_on: Optional[RunsOn]` - `docker: Optional[Docker]` - `environment: Optional[List[str]]` - `image: Optional[str]` - `machine: Optional[object]` Machine runs the service/task directly on the VM/machine level. ### Returns - `object` ### Example ```python import os from gitpod import Gitpod client = Gitpod( bearer_token=os.environ.get("GITPOD_API_KEY"), # This is the default and can be omitted ) task = client.environments.automations.tasks.update( id="d2c94c27-3b76-4a42-b88c-95a85e392c68", spec={ "command": "npm run test:coverage" }, ) print(task) ``` #### Response ```json {} ```