legacy_github: GitHub board (legacy API)

Description Usage Arguments Large Files Examples

View source: R/legacy_github.R

Description

To use a GitHub board, you'll need to set up authentication. This is likely to just work if you already use GitHub for other purposes since pins will inspect your GITHUB_PAT environment variable. Otherwise, you can follow the instructions at https://happygitwithr.com/credential-caching.html to get set up.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
legacy_github(
  repo,
  branch = NULL,
  token = NULL,
  path = "",
  host = "https://api.github.com",
  name = "github",
  ...
)

board_register_github(
  name = "github",
  repo = NULL,
  branch = NULL,
  token = NULL,
  path = "",
  host = "https://api.github.com",
  cache = board_cache_path(name),
  ...
)

Arguments

repo

The GitHub repository formatted as 'owner/repo'.

branch

The branch to use to commit pins. Default, NULL, will use main or master if present.

token

GitHub personal acess token. Defaults to env var GITHUB_PAT if not set.

path

The subdirectory in the repo where the pins will be stored.

host

The URL of the GitHub API. You'll need to customise this to use GitHub enterprise, e.g. "https://yourhostname/api/v3".

name

An optional name used identify the board. This is no longer generally needed since you should be passing around an explicit board object.

...

Additional parameters required to initialize a particular board.

cache

Cache path. Every board requires a local cache to avoid downloading files multiple times. The default stores in a standard cache location for your operating system, but you can override if needed.

Large Files

A GitHub repo only supports files under 25MB in size (100MB in theory but there is additional overhead when using the GitHub API). To store large files, GitHub recommends storing them using GitHub Releases which support up to 2GB files, which is what pins uses. You don't need to do anything extra as this will happen behind the scenes, but don't be surprised if pins creates releases in your repo.

Examples

1
2
3
4
5
## Not run: 
# the following example requires a GitHub API key
board <- legacy_github("owner/repo")

## End(Not run)

pins documentation built on Oct. 2, 2021, 5:06 p.m.