update_gist: Update a gist in GitHub

Description Usage Arguments Details Value Examples

Description

This function updates an existing gist in GitHub. You can specify add or update files by providing a named list and rename a file (see examples).

Usage

1
update_gist(gist, files, description, ...)

Arguments

gist

(string) The ID of the gist

files

(list, optional) The file contents with the list names as the filenames. Adding a filename element changes the filename (see examples).

description

(string, optional) A description for the gist.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

update_gist() returns a list of the gist's properties.

Gist Properties:

Examples

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

  # Update a gist's description
  update_gist(
    gist        = "806dca6b09a39e7b6326a0c8137583e6",
    description = "An updated description"
  )

  # Update the contents of a file
  update_gist(files = list(hello_world.R = "cat(\"Hello World!\")"))

  # Update the contents of a file and the filename
  update_gist(
    files = list(
      hello_world.R = c("cat(\"Hello World!\")", filename = "new_filename.R")
    )
  )


## End(Not run)

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