Get Merge Checks
Returns comprehensive information about merge requirements:
- Code review status and approval rules
- Merge conflicts detection
- CI workflow execution status
- Configuration validation results
Request
GET
https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/pulls/{pull_request_slug}/merge-checks
Path parameters
|
Name |
Description |
|
org_slug |
Type: string Example: `` |
|
pull_request_slug |
Type: string Example: `` |
|
repo_slug |
Type: string Example: `` |
Query parameters
|
Name |
Description |
|
pull_request_id |
Type: string Example: `` |
Responses
200 OK
A successful response.
Body
application/json
{
"code_review": {
"status": "in_progress",
"disabled": true,
"total_approves": 0,
"need_approves": 0,
"rules": [
{
"approves": 0,
"need_approves": 0,
"completed": true,
"reviewers": [
{}
]
}
]
},
"conflicts": {
"status": null,
"created_at": "2025-01-01T00:00:00Z",
"conflicts": [
{
"conflict_type": "example",
"path": "example",
"message": "example"
}
],
"error": "example"
},
"ci_workflows": [
{
"status": "created",
"disabled": true,
"created_at": "2025-01-01T00:00:00Z",
"run_id": "example",
"run_slug": "example",
"workflow_id": "example",
"workflow_slug": "example"
}
],
"config_validations": [
{
"status": null,
"created_at": "2025-01-01T00:00:00Z",
"file_path": "example",
"error_message": "example"
}
],
"status": null
}
|
Name |
Description |
|
ci_workflows |
Type: CIWorkflowCheck[] Example
|
|
code_review |
Type: CodeReviewCheck Example
|
|
config_validations |
Type: ConfigValidationCheck[] Example
|
|
conflicts |
Type: ConflictsCheck Example
|
|
status |
Type: MergeChecks.Status Enum: |
MergeChecks.Status
Type: string
Enum: in_progress, success, failure
UserEmbedded
|
Name |
Description |
|
id |
Type: string Example: |
|
slug |
Type: string Example: |
Example
{
"id": "example",
"slug": "example"
}
ReviewRule
|
Name |
Description |
|
approves |
Type: integer |
|
completed |
Type: boolean |
|
need_approves |
Type: integer |
|
reviewers |
Type: UserEmbedded[] Example
|
Example
{
"approves": 0,
"need_approves": 0,
"completed": true,
"reviewers": [
{
"id": "example",
"slug": "example"
}
]
}
CodeReviewCheck
|
Name |
Description |
|
disabled |
Type: boolean |
|
need_approves |
Type: integer |
|
rules |
Type: ReviewRule[] Example
|
|
status |
Type: MergeChecks.Status Enum: |
|
total_approves |
Type: integer |
Example
{
"status": "in_progress",
"disabled": true,
"total_approves": 0,
"need_approves": 0,
"rules": [
{
"approves": 0,
"need_approves": 0,
"completed": true,
"reviewers": [
{
"id": "example",
"slug": "example"
}
]
}
]
}
Conflict
|
Name |
Description |
|
conflict_type |
Type: string Example: |
|
message |
Type: string Example: |
|
path |
Type: string Example: |
Example
{
"conflict_type": "example",
"path": "example",
"message": "example"
}
ConflictsCheck
|
Name |
Description |
|
conflicts |
Type: Conflict[] Example
|
|
created_at |
Type: string<date-time> Example: |
|
error |
Type: string Example: |
|
status |
Type: MergeChecks.Status Enum: |
Example
{
"status": "in_progress",
"created_at": "2025-01-01T00:00:00Z",
"conflicts": [
{
"conflict_type": "example",
"path": "example",
"message": "example"
}
],
"error": "example"
}
Run.Status
- prepared: Status
preparedmay only appear as a Run status.
It's a stage between creation and startup during which the Run is populated with workflows.
Type: string
Enum: created, prepared, processing, success, failed, canceled, timeout
CIWorkflowCheck
Different CI workflows may have different corresponding CI runs due to restarts.
To get detailed information about each workflow, use /{org_slug}/{repo_slug}/cicd/runs/{run_slug}/{workflow_slug}.
|
Name |
Description |
|
created_at |
Type: string<date-time> Example: |
|
disabled |
Type: boolean |
|
run_id |
Type: string Example: |
|
run_slug |
Type: string Example: |
|
status |
Type: Run.Status
Enum: |
|
workflow_id |
Type: string Example: |
|
workflow_slug |
Type: string Example: |
Example
{
"status": "created",
"disabled": true,
"created_at": "2025-01-01T00:00:00Z",
"run_id": "example",
"run_slug": "example",
"workflow_id": "example",
"workflow_slug": "example"
}
ConfigValidationCheck
|
Name |
Description |
|
created_at |
Type: string<date-time> Example: |
|
error_message |
Type: string Example: |
|
file_path |
Type: string Example: |
|
status |
Type: MergeChecks.Status Enum: |
Example
{
"status": "in_progress",
"created_at": "2025-01-01T00:00:00Z",
"file_path": "example",
"error_message": "example"
}
default
Both Client Errors (4xx) and Server Errors (5xx) are serialized into this scheme
Body
application/json
{
"error_code": "example",
"message": "example",
"request_id": "example",
"details": {}
}
|
Name |
Description |
||
|
details |
Type: Optional details. Exact structure depends on error_code
Example
|
||
|
error_code |
Type: string Example: |
||
|
message |
Type: string Example: |
||
|
request_id |
Type: string Example: |