跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support

Upload a SARIF report of code scanning results

POST
/repos/{owner}/{repo}/security/code_scanning/sarifs
curl --request POST \
--url https://gitea.example.com/api/v1/repos/example/example/security/code_scanning/sarifs \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "commit_sha": "example", "ref": "example", "sarif": "example", "tool_name": "example" }'

Gitea Enterprise only. This endpoint is not part of the community edition.

Stores the report for a branch and queues a scan of it. An upload replaces the report the same branch and tool had, which is what a scan reconciles with. The report may be the SARIF document itself or its base64, gzip or zlib compressed, which is the encoding the clients of the reference API send.

owner
required
string

Name of the owner

repo
required
string

Name of the repository

Media typeapplication/json

UploadCodeScanningReportOptions is the body of the code scanning upload endpoint. It carries the fields the reference API of code scanning uploads carries, with the report as it is or base64 encoded and compressed.

object
commit_sha

Commit the report was produced for

string
ref

Reference of the branch the report is about, either “refs/heads/main” or “main”; empty means the default branch

string
sarif

The SARIF report itself, or its base64, gzip or zlib compressed

string
tool_name

Name the report is stored under, empty means the tool of the report

string
Examplegenerated
{
"commit_sha": "example",
"ref": "example",
"sarif": "example",
"tool_name": "example"
}

CodeScanningReportUpload

Media typeapplication/json
CodeScanningReportUpload is what an accepted upload answers with.
object
id

Id of the stored report

integer format: int64
url

Where the findings of that branch are read

string format: uri
Examplegenerated
{
"id": 1,
"url": "https://example.com"
}

APIForbiddenError is a forbidden error response

message
string
url
string

APIError is error format response

message
string
url
string

APIValidationError is error format response related to input validation

message
string
url
string