Run Workflows in Repository
Request
POST
https://api.sourcecraft.tech/repos/{org_slug}/{repo_slug}/cicd/runs
Path parameters
|
Name |
Description |
|
org_slug |
Type: string Example: `` |
|
repo_slug |
Type: string Example: `` |
Body
application/json
{
"head": {
"branch": "example",
"tag": "example",
"commit": "example"
},
"config_revision": null,
"workflows": [
{
"name": "example",
"values": [
{
"name": "example",
"value": "example"
}
]
}
],
"shared": true
}
|
Name |
Description |
|
config_revision |
Type: GitRevision Exactly one of the fields must be provided Example
|
|
head |
Type: GitRevision Exactly one of the fields must be provided Example
|
|
shared |
Type: boolean |
|
workflows |
Type: WorkflowData[] Information specifying which workflows to run. Example
|
GitRevision
Exactly one of the fields must be provided
|
Name |
Description |
|
branch |
Type: string Example: |
|
commit |
Type: string Example: |
|
tag |
Type: string Example: |
Example
{
"branch": "example",
"tag": "example",
"commit": "example"
}
InputValue
|
Name |
Description |
|
name |
Type: string Example: |
|
value |
Type: string Example: |
Example
{
"name": "example",
"value": "example"
}
WorkflowData
|
Name |
Description |
|
name |
Type: string The name of a workflow to run as defined in the config. Example: |
|
values |
Type: InputValue[] List of input parameters (name, value pairs) to pass to the workflow. Example
|
Example
{
"name": "example",
"values": [
{
"name": "example",
"value": "example"
}
]
}
Responses
200 OK
A successful response.
Body
application/json
{
"id": "example",
"slug": "example",
"dates": {
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "created",
"workflows": [
{
"id": "example",
"slug": "example",
"description": "example",
"dates": null,
"status": null,
"tasks": [
{
"id": "example",
"slug": "example",
"description": "example",
"dates": null,
"status": null,
"cubes": [
null
],
"progress": {},
"relations": {}
}
],
"progress": null
}
],
"event_type": "push",
"error_messages": [
"example"
],
"pull": {
"id": "example",
"slug": "example"
},
"user": {
"id": "example",
"slug": "example"
}
}
|
Name |
Description |
|
dates |
Type: DatesByStage Example
|
|
error_messages |
Type: string[] Example
|
|
event_type |
Type: EventType Enum: |
|
id |
Type: string Example: |
|
pull |
Type: PullRequestEmbedded Example
|
|
slug |
Type: string Example: |
|
status |
Type: Run.Status
Enum: |
|
user |
Type: UserEmbedded Example
|
|
workflows |
Type: Workflow[] Example
|
DatesByStage
|
Name |
Description |
|
created_at |
Type: string<date-time> Example: |
|
finished_at |
Type: string<date-time> Example: |
|
started_at |
Type: string<date-time> Example: |
|
updated_at |
Type: string<date-time> Example: |
Example
{
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
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
ArtifactDates
|
Name |
Description |
|
obtained_at |
Type: string<date-time> Example: |
|
registered_at |
Type: string<date-time> Example: |
|
updated_at |
Type: string<date-time> Example: |
Example
{
"registered_at": "2025-01-01T00:00:00Z",
"obtained_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
}
ArtifactStatus
Type: string
Enum: registered, success, failed, missing
Artifact
|
Name |
Description |
|
dates |
Type: ArtifactDates Example
|
|
download_url |
Type: string A temporary download URL, will be valid for a short period of time after acquisition. Example: |
|
id |
Type: string Example: |
|
local_path |
Type: string Artifacts do not have a slug as we define it. Example: |
|
status |
Type: ArtifactStatus Enum: |
Example
{
"id": "example",
"local_path": "example",
"dates": {
"registered_at": "2025-01-01T00:00:00Z",
"obtained_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "registered",
"download_url": "example"
}
Dependency
|
Name |
Description |
|
name |
Type: string Example: |
Example
{
"name": "example"
}
Relations
|
Name |
Description |
|
needs |
Type: Dependency[] Example
|
Example
{
"needs": [
{
"name": "example"
}
]
}
Cube
|
Name |
Description |
|
artifacts |
Type: Artifact[] Example
|
|
dates |
Type: DatesByStage Example
|
|
id |
Type: string Example: |
|
relations |
Type: Relations Example
|
|
slug |
Type: string Example: |
|
status |
Type: Run.Status
Enum: |
Example
{
"id": "example",
"slug": "example",
"dates": {
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "created",
"artifacts": [
{
"id": "example",
"local_path": "example",
"dates": {
"registered_at": "2025-01-01T00:00:00Z",
"obtained_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "registered",
"download_url": "example"
}
],
"relations": {
"needs": [
{
"name": "example"
}
]
}
}
Progress
|
Name |
Description |
|
current_cube |
Type: Cube Example
|
|
percent |
Type: number |
Example
{
"percent": 0.5,
"current_cube": {
"id": "example",
"slug": "example",
"dates": {
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "created",
"artifacts": [
{
"id": "example",
"local_path": "example",
"dates": {
"registered_at": "2025-01-01T00:00:00Z",
"obtained_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "registered",
"download_url": "example"
}
],
"relations": {
"needs": [
{
"name": "example"
}
]
}
}
}
Task
|
Name |
Description |
|
cubes |
Type: Cube[] Example
|
|
dates |
Type: DatesByStage Example
|
|
description |
Type: string Example: |
|
id |
Type: string Example: |
|
progress |
Type: Progress Example
|
|
relations |
Type: Relations Example
|
|
slug |
Type: string Example: |
|
status |
Type: Run.Status
Enum: |
Example
{
"id": "example",
"slug": "example",
"description": "example",
"dates": {
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "created",
"cubes": [
{
"id": "example",
"slug": "example",
"dates": null,
"status": null,
"artifacts": [
{
"id": "example",
"local_path": "example",
"dates": {},
"status": "registered",
"download_url": "example"
}
],
"relations": {
"needs": [
{}
]
}
}
],
"progress": {
"percent": 0.5,
"current_cube": null
},
"relations": null
}
Workflow
|
Name |
Description |
|
dates |
Type: DatesByStage Example
|
|
description |
Type: string Example: |
|
id |
Type: string Example: |
|
progress |
Type: Progress Example
|
|
slug |
Type: string Example: |
|
status |
Type: Run.Status
Enum: |
|
tasks |
Type: Task[] Example
|
Example
{
"id": "example",
"slug": "example",
"description": "example",
"dates": {
"created_at": "2025-01-01T00:00:00Z",
"started_at": "2025-01-01T00:00:00Z",
"finished_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-01-01T00:00:00Z"
},
"status": "created",
"tasks": [
{
"id": "example",
"slug": "example",
"description": "example",
"dates": null,
"status": null,
"cubes": [
{
"id": "example",
"slug": "example",
"dates": null,
"status": null,
"artifacts": [
null
],
"relations": {}
}
],
"progress": {
"percent": 0.5,
"current_cube": null
},
"relations": null
}
],
"progress": null
}
EventType
Type: string
Enum: push, pr_update, manual, restart
PullRequestEmbedded
|
Name |
Description |
|
id |
Type: string Example: |
|
slug |
Type: string Example: |
Example
{
"id": "example",
"slug": "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: |