| ghr | R Documentation |
Functions to query and manipulate GitHub releases. These functions are currently experimental.
ghr$list() lists the last 100 releases for a GitHub repository.
ghr$async_list() is the async version of ghr$list().
ghr$list(repo) ghr$async_list(repo)
repo: repository slug, e.g. "cran/cli".
Data frame with columns:
id: release id,
name: release name, usually the version number, possibly with
a v prefix: 3.6.1 or v3.6.1, but can be different.
tag_name: usually the same as name.
created_at: POSIXct vector.
ghr$get() downloads information about a release, including
release assets.
ghr$async_get is the async version of ghr$get.
ghr$get(repo, tag)
repo: repository slug, e.g. "cran/cli".
tag: tag to get.
Named list, see https://docs.github.com/en/rest/releases/releases#get-a-release for the entries.
ghr$list_assets() lists the last 100 assets of a release.
ghr$async_list_assets() is the async version of ghr$list_assets()
ghr$list_assets(repo, tag)
repo: repository slug, e.g. "cran/cli".
tag: tag to query.
Data frame with columns:
id: asset id,
name: file name of the asset,
download_url: download URL,
size: size in bytes,
created_at: POSIXct vector,
updated_at: POSXct vector,
content_type: content type of asset.
ghr$add_asset() adds an asset to a GitHub release.
ghr$async_add_asset() is the async version of ghr$add_asset().
ghr%add_asset(repo, file, tag, name = basename(file))
repo: repository slug, e.g. cran/cli.
file: path to file to upload as an asset.
tag: tag name to add the asset to. It must exist on GitHub.
name: file name of the asset in the release.
If an asset with the same name already exists, then that will be deleted first.
Response from GitHub as a named list. See https://docs.github.com/en/rest/releases/assets#upload-a-release-asset for the structure.
ghr$delete_asset() deleted a release asset.
ghr$async_delete_asset() is an async version of ghr$delete_asset().
ghr$delete_asset(repo, tag, name) ghr$async_delete_asset(repo, tag, name)
repo: repository slug, e.g. cran/cli.
tag: tag name to create a release for. It must exist on GitHub.
name: name of the asset.
A list with entries:
release: a list with the data about the release, before the
deletion. It has the same format as the return value of ghr$get().
deleted: TRUE if the asset was deleted. FALSE if the asset
did not exist.
ghr$create() creates a GitHub release from a tag.
ghr$async_create() is an async version of ghr$create().
ghr$create( repo, tag, description = "", draft = FALSE, prerelease = FALSE, generage_release_notes = FALSE )
repo: repository slug, e.g. cran/cli.
tag: tag name to create a release for. It must exist on GitHub.
description: release description.
draft: whether to create a draft release.
prerelease: whether to create a prerelease.
generate_release_notes: whether to auto-generate release notes.
Response from GitHub as a named list. See https://docs.github.com/en/rest/releases/releases#create-a-release for the structure.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.