update_release: Update a release in a repository

Description Usage Arguments Details Value Examples

View source: R/releases.R

Description

This function updates a release in the specified repository. It can be used to update properties, such as name or whether it is draft, or it can be used to point the release at a new commit by providing a Git reference, which can be either a SHA or branch.

Usage

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

Arguments

release

(string) The id or current tag of the release.

repo

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

tag

(string, optional) The name of the new tag.

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

update_release() returns a list of the release 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
## Not run: 

  update_release(
    release = "1.0.0",
    repo    = "ChadGoymer/githapi",
    tag     = "1.0.1",
    name    = "Updated production release",
    body    = "This release has been updated by update_release()"
  )

  update_release(
    release    = 1234567,
    tag        = "1.0.1",
    repo       = "ChadGoymer/githapi",
    name       = "Promoted draft release",
    body       = "This release has been updated by update_release()",
    draft      = FALSE,
    prerelease = FALSE
  )


## End(Not run)

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