gitpublish module route (requires gitpublish:merge:admin)
POST
/v1/m/gitpublish/targets/{id}/merges
const url = 'https://example.com/v1/m/gitpublish/targets/example/merges';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"acknowledge_intent":"example","expected_base":"example","expected_head":"example","expected_result_tree":"example","method":"merge","number":1,"operation_id":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/m/gitpublish/targets/example/merges \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "acknowledge_intent": "example", "expected_base": "example", "expected_head": "example", "expected_result_tree": "example", "method": "merge", "number": 1, "operation_id": "example" }'Merges one pull request only while its head is still the reviewed expected_head, and returns the publication intent with the merge commit and tree it recorded.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” id
required
string
Path parameter id.
Header Parameters
Section titled “ Header Parameters ” X-Olivares-Tenant
string format: uuid
Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “ Request Body required ”The handler decodes one strict JSON document, bounded at 1 MiB; an unknown field is field_not_accepted.
Media type application/json
object
acknowledge_intent
string
expected_base
Unsupported: refused with unsupported_requirement.
string
expected_head
required
The reviewed source head; the host refuses the merge if the head differs.
string
expected_result_tree
Unsupported: refused with unsupported_requirement.
string
method
required
Rebase is refused as unsupported_requirement on a GitLab target.
string
number
required
integer
operation_id
required
Client idempotency key.
string
Responses
Section titled “ Responses ”OK
Media type application/json
object
Example generated
{}Bad request
Media type application/json
object
Example generated
{}Unauthenticated
Media type application/json
object
Example generated
{}Forbidden
Media type application/json
object
Example generated
{}Not found
Media type application/json
object
Example generated
{}Conflict / setup required
Media type application/json
object
Example generated
{}Rate limited
Media type application/json
object
Example generated
{}