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.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" spec: command: "npm run test:coverage" -
Update triggers:
Modifies when the task runs.
id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" metadata: triggeredBy: trigger: - postEnvironmentStart: true
UpdateTask
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){}Returns Examples
{}