Save the agent's GitHub settings
Replaces the agent's whole settings row in one transaction and makes no release: a new session reads it at once, and a change that narrows reaches running sessions too. expected_revision is settings_revision as read (null when there was no row); another value answers 409 REVISION_CONFLICT. push_attached is optional: left out, a first save writes allow and a later save keeps the row's value. updated_by is always the caller, so the first save of an agent also fixes the rollback floor at the snapshot-reading image. Only repositories the save adds are checked against the catalog and the workspace's repository ceiling, and features it turns on against the feature ceiling (400 with reason_code). Writes a set_agent_github receipt with result.change = "settings" and the values before and after; receipt_id is null when a person's row already held them. Agent managers with a web session only; API keys are refused.
Auth: cookie session only; no scope. Idempotency-Key: ignored.
cookieSession__Host-werft_session<token>For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.
id*stringThe agent's id.
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$uuidX-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
"werft-web"application/json- body
expected_revision*|nullsettings*start_repository_id*|nullpush_attached?string"allow""ask""deny"Saved.
application/json- response
settings_revision*integer-9007199254740991 <= value <= 9007199254740991receipt_id*|nullcurl -X PUT 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/github/settings' \ -H 'Content-Type: application/json' \ -d '{ "expected_revision": 3, "settings": { "repositories": [ "werft-sandbox" ], "push_approval": true, "features": { "workflows": false, "actions": true, "checks": false, "issues": false, "review": false }, "actions_allow": [ { "workflow": "ci.yml" } ] }, "start_repository_id": "werft-sandbox", "push_attached": "allow"}'{ "settings_revision": 4, "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}