Modify a file within a repository

repo_modify_file(
  repo,
  path,
  pattern,
  content,
  method = c("replace", "before", "after"),
  all = FALSE,
  message = "Modified content",
  branch = "master"
)

Arguments

repo

Character. Address of repository in owner/name format.

path

Character. File's path within the repository.

pattern

Character. Regex pattern.

content

Character. Content to be added to the file.

method

Character. Should the content replace the matched pattern or be inserted before or after the match.

all

Character. Should all instances of the pattern be modified (TRUE) or just the first (FALSE).

message

Character. Commit message.

branch

Character. Name of branch to use, defaults to "master".