Create a commit status
const url = 'https://gitea.com/api/v1/repos/example/example/statuses/example';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"context":"example","description":"example","state":"pending","target_url":"https://example.com"}'};
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://gitea.com/api/v1/repos/example/example/statuses/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "context": "example", "description": "example", "state": "pending", "target_url": "https://example.com" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Owner of the repo
Name of the repo
Sha of the commit
Request Body
Section titled “Request Body”CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
object
Context is the unique context identifier for the status
Description provides a brief description of the status
State represents the status state to set (pending, success, error, failure)
TargetURL is the URL to link to for more details
Responses
Section titled “Responses”CommitStatus
CommitStatus holds a single status of a single Commit
object
Context is the unique context identifier for the status
User represents a user
object
Is user active
URL to the user’s avatar
The user’s description
User counts
The user’s full name
URL to the user’s gitea page
The user’s id
Is the user an administrator
User locale
The user’s location
Login of the user, same as username
Identifier of the user, provided by the external authenticator (if configured)
Is user login prohibited
Is user restricted
The ID of the user’s Authentication Source
User visibility level option: public, limited, private
The user’s website
Description provides a brief description of the status
ID is the unique identifier for the commit status
State represents the status state (pending, success, error, failure)
TargetURL is the URL to link to for more details
URL is the API URL for this status
Example
{ "creator": { "visibility": "public" }, "status": "pending"}APIError is error format response
Headers
Section titled “Headers”APINotFound is a not found empty response