Set the code intake of a project (tenant:forge:write and maintainer, or tenant:forge:admin)
PUT /api/forge/v1/projects/{key}/scm-intake-settings
Module: Forge · operationId: putProjectScmIntakeSettings · Tag: Projects · Auth: access token (Authorization: Bearer <accessToken>)
Requires tenant:forge:admin, or tenant:forge:write and project role maintainer or admin. Stores settings.scmIntake of the project (the project's settings answer it): with enabled, a failed GitHub workflow run (workflowTypeKey) or an opened security alert (alertTypeKey) of one of the project's repositories becomes an item of that type (actor kind scm; the first active project, oldest first, whose repositories include the repository and whose intake takes the kind). While that item is open, repeats, the recovery and the resolution are system comments on it; once it is closed the next failure opens a new one. Type keys must exist (400); enabled needs at least one. Writes forge.config.updated.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
key |
path | string | yes | Project key (e.g. APP) |
Request body
application/json (required)
alertKinds(array of string): Only alerts of these kinds; empty = allalertLabels(array of string): Label names put on the items of security alertsalertTypeKey(string): Item type of security alerts; empty = noneassigneeRef(string): E-mail of a member with at least the developer role; assigned to every intake itembranches(array of string): Only failed runs on these branches: exact names or patterns (release/*); empty = every branchenabled(boolean): Failed workflow runs and security alerts of the linked repositories become itemsminSeverity(string): Only alerts of this severity and above (an alert without a known severity is taken); empty = all (one oflow,medium,high,critical)workflowLabels(array of string): Label names put on the items of failed workflow runs (a label deleted or renamed since is skipped)workflowTypeKey(string): Item type of failed workflow runs; empty = none
Example:
{
"alertKinds": [
"dependabot",
"code_scanning"
],
"alertLabels": [
"bereich::sicherheit"
],
"alertTypeKey": "fehler",
"assigneeRef": "paul.schmid@muster-it.example",
"branches": [
"main",
"release/*"
],
"enabled": true,
"minSeverity": "high",
"workflowLabels": [
"bug"
],
"workflowTypeKey": "fehler"
}
Responses
- 200 Saved (
application/json) - 400 Error (
application/json) - 403 Error (
application/json) - 404 Error (
application/json) - 409 Error (
application/json)
Fields of the 200 answer:
alertKinds(array of string): Only alerts of these kinds; empty = allalertLabels(array of string): Label names put on the items of security alertsalertTypeKey(string): Item type of security alerts; empty = noneassigneeRef(string): E-mail of a member with at least the developer role; assigned to every intake itembranches(array of string): Only failed runs on these branches: exact names or patterns (release/*); empty = every branchenabled(boolean): Failed workflow runs and security alerts of the linked repositories become itemsminSeverity(string): Only alerts of this severity and above (an alert without a known severity is taken); empty = all (one oflow,medium,high,critical)workflowLabels(array of string): Label names put on the items of failed workflow runs (a label deleted or renamed since is skipped)workflowTypeKey(string): Item type of failed workflow runs; empty = none
Example 200 answer:
{
"alertKinds": [
"dependabot",
"code_scanning"
],
"alertLabels": [
"bereich::sicherheit"
],
"alertTypeKey": "fehler",
"assigneeRef": "paul.schmid@muster-it.example",
"branches": [
"main",
"release/*"
],
"enabled": true,
"minSeverity": "high",
"workflowLabels": [
"bug"
],
"workflowTypeKey": "fehler"
}
Example request
curl -X PUT 'https://api.mbcom.cloud/api/forge/v1/projects/string/scm-intake-settings' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H 'Content-Type: application/json' \
--data '{"alertKinds":["dependabot","code_scanning"],"alertLabels":["bereich::sicherheit"],"alertTypeKey":"fehler","assigneeRef":"paul.schmid@muster-it.example","branches":["main","release/*"],"enabled":true,"minSeverity":"high","workflowLabels":["bug"],"workflowTypeKey":"fehler"}'