Source repositories
Git repositories a task reads in a copy cloned on every run (task.sources). Only the address and the credential: the code never goes through the API.
| Command | HTTP | Description |
|---|---|---|
sources list | GET /v1/sources | List source repositories |
sources create | POST /v1/sources | Register a source repository |
sources get | GET /v1/sources/{id} | Get a source repository |
sources update | PATCH /v1/sources/{id} | Update a source repository |
sources delete | DELETE /v1/sources/{id} | Delete a source repository (soft delete) |
sources check | POST /v1/sources/{id}/check | Check access to the repository |
Examples​
--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits the fields that come back — worth using on every list/get to save context. See Global flags for the full reference.
# List source repositories
kobana kadu sources list --fields "id,name,repository,auth_method,access_status"
# Register a source repository
kobana kadu sources create \
--json '{"name": "apps-billing", "repository": "acme/billing", "ref": "main"}'
# Get the repository: with a deploy key, the public key to register on GitHub
kobana kadu sources get --params '{"id": "SOURCE_ID"}' \
--fields "access_status,deploy_key_public_key,deploy_key_settings_url,next_step"
# Update a source repository (changing the ref resets the check)
kobana kadu sources update \
--params '{"id": "SOURCE_ID"}' \
--json '{"ref": "release"}'
# Check access after registering the deploy key
kobana kadu sources check --params '{"id": "SOURCE_ID"}' \
--fields "access_status,last_commit_sha,last_check_error"
# Delete a source repository (soft delete)
kobana kadu sources delete \
--params '{"id": "SOURCE_ID"}' \
--dry-run
Next steps​
- Source repositories — how a task declares and reads a repository.
- Schema introspection — every parameter this resource accepts.