create_status: Create a status for a commit

Description Usage Arguments Details Value Examples

View source: R/statuses.R

Description

This function creates a new status for a commit in the specified repository in GitHub. The status can also have a description and a target URL, allowing a user to link to more information. The context allows you to differentiate the status from others. The status can then be updated, from pending to success say, by using the same context.

Usage

1
2
3
4
5
6
7
8
9
create_status(
  state,
  ref,
  repo,
  description,
  target_url,
  context = "default",
  ...
)

Arguments

state

(string) The state of the status. Can be one of "error", "failure", "pending", or "success".

ref

(string) Either a SHA, branch or tag used to identify the commit.

repo

(string) The repository specified in the format: owner/repo.

description

(string, optional) A short description of the status.

target_url

(string, optional) The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status.

context

(string, optional) A string label to differentiate this status from the status of other systems. Default: "default".

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_status() returns a list of the status's properties.

Status Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## Not run: 

  # Create a status on the main branch
  create_status(
    state       = "pending",
    ref         = "main",
    repo        = "ChadGoymer/test-githapi",
    description = "This is a pending status",
    target_url  = "https://goymer.me/githapi",
    context     = "test/githapi"
  )

  # Update the status on the main branch
  create_status(
    state       = "success",
    ref         = "main",
    repo        = "ChadGoymer/test-githapi",
    description = "This is a success status",
    target_url  = "https://goymer.me/githapi",
    context     = "test/githapi"
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.