Pin the App connection a repository's work uses for a role (owner or admin)
Sets the connection role's tokens for the repository are issued from. The connection must be the workspace's and of that role (else 404, or 400 role_mismatch), and an installation of its App must cover the repository now (400 not_installed); GitHub not answering is 502 GITHUB_UNAVAILABLE. Tokens already issued keep working until they expire; the next one comes from the new connection. Writes a set_repository_github_app receipt with the connection before and after; receipt_id is null when it was already pinned there. 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 workspace'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)$uuidrepositoryId*stringThe repository's id in the workspace's repository catalog.
1 <= length <= 200role*stringThe GitHub App role the pin is for.
"author""reviewer"X-Requested-With?"werft-web"Required with a cookie session: the literal werft-web.
"werft-web"application/json- body
connection_id*string^([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)$uuidPinned; the receipt.
application/json- response
catalog_id*string1 <= lengthrole*string"author""reviewer"connection_id*string^([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)$uuidreceipt_id*|nullcurl -X PUT 'https://example.com/v1/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/github-repositories/string/app-pins/author' \ -H 'Content-Type: application/json' \ -d '{ "connection_id": "019a0000-0000-7000-8000-0000000000c9"}'{ "catalog_id": "app", "role": "author", "connection_id": "019a0000-0000-7000-8000-0000000000c9", "receipt_id": "c4a1e9d2-7b3f-4e8a-a6c5-1d2e3f4a5b6c"}