create_release: Create a release in a repository

Description Usage Arguments Details Value Examples

View source: R/releases.R

Description

This function creates a new release in the specified repository in GitHub. It must be pointed at a commit by providing an existing tag or a Git reference, which can be either a SHA or branch. If the tag does not exist it is created pointing at the commit; if it does exist then the reference is ignored.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
create_release(
  tag,
  repo,
  name,
  body,
  ref,
  draft = FALSE,
  prerelease = FALSE,
  ...
)

Arguments

tag

(string) The name of the tag.

repo

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

name

(string, optional) The name of the release.

body

(string, optional) The description of the release.

ref

(string, optional) Either a SHA or branch used to identify the commit. If the tag exists this ref is ignored. If not supplied the repositories default branch is used.

draft

(boolean, optional) Whether the release is a draft. Default: FALSE.

prerelease

(boolean, optional) Whether the release is a pre-release. Default: FALSE.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_release() returns a list of the release's properties.

Release 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
## Not run: 

  # Create a release on the default branch
  create_release(
    tag  = "1.0.0",
    repo = "ChadGoymer/githapi",
    name = "Initial production release",
    body = "This is a release created by create_release()"
  )

  # Create a draft pre-release
  create_release(
    tag        = "1.0.9000",
    repo       = "ChadGoymer/githapi",
    name       = "Draft 1.1 release",
    body       = "This is a release created by create_release()",
    ref        = "dev-branch",
    draft      = TRUE,
    prerelease = TRUE
  )


## End(Not run)

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