view_files: View files within a repository

Description Usage Arguments Details Value Examples

Description

view_files() summarises files in a table with the properties as columns and a row for each file in the repository. view_file() returns a list of all properties for a single file. browse_files() and browse_file() open the web page for the commit tree and blob respectively in the default browser.

Usage

1
2
3
4
5
6
7
view_files(ref, repo, recursive = TRUE, ...)

view_file(path, ref, repo, ...)

browse_files(ref, repo, ...)

browse_file(path, ref, repo, ...)

Arguments

ref

(string) Either a SHA, branch or tag used to identify the commit.

repo

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

recursive

(boolean, optional) Whether to list files in subfolders as well. Default: TRUE.

...

Parameters passed to gh_page() or gh_request().

path

(string) The path to the file, within the repository.

Details

You can summarise all the milestones of a repository in a specified state and change the order they are returned using sort and direction.

For more details see the GitHub API documentation:

Value

view_files() returns a tibble of file properties. view_file() returns a list of properties for a single file. browse_files() and browse_file() opens the default browser on the tree or blob page and returns the URL.

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

  # View files on the main branch in a repository
  view_files("main", "ChadGoymer/githapi")

  # View properties of a single file in a repository
  view_file(
    path = "README.md",
    ref  = "main",
    repo = "ChadGoymer/githapi"
  )

  # Open the commit's tree page in the default browser
  browse_files("main", "ChadGoymer/githapi")

  # Open the file's blob page in the default browser
  browse_file(
    path = "README.md",
    ref  = "main",
    repo = "ChadGoymer/githapi"
  )


## End(Not run)

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