Learn R Programming

multideploy

The {multideploy} package provides tools for deploying file changes across multiple GitHub repositories. It’s designed to help you manage standardized configurations, CI/CD workflows, and other common files that need to be synchronized across multiple repositories.

Installation

You can install the development version of {multideploy} from GitHub with:

# install.packages("remotes")
remotes::install_github("coatless-rpkg/multideploy")

Authentication

{multideploy} uses the gh package for GitHub API authentication and querying. Before using {multideploy}, make sure you have a GitHub Personal Access Token (PAT) set up:

# Set GitHub PAT (or use .Renviron)
Sys.setenv(GITHUB_PAT = askpass::askpass("What is your GitHub Personal Access Token (PAT)?"))

For regular use, it’s recommended to add your PAT to the git credential system through the {gitcreds} package:

gitcreds::gitcreds_set()

Quick Start Example

Here’s an example showing how to deploy a standardized CI workflow file to multiple repositories using {multideploy}:

library(multideploy)

# List repositories in an organization matching a pattern
repos <- repos("my-organization", filter_regex = "^api-")

# Deploy a CI workflow file to the selected repositories
results <- file_deploy(
  source_file = "templates/check-standard.yml",
  target_path = ".github/workflows/R-CMD-check.yaml",
  repos = repos
)

# View results
print(results)

[!IMPORTANT]

The GitHub PAT used for authentication must have the necessary permissions to access and modify the repositories’ workflows.

Extended Overview

If you’re looking for more detailed examples on how to use {multideploy}, we step through the additional features of the package within this section.

Repository Selection

List and filter repositories across users or organizations:

# Get all public repositories for a user
user_repos <- repos("username", type = "public")

# Get repositories for an organization matching a pattern
org_repos <- repos("orgname", filter_regex = "^data-")

# List organizations you have access to
my_orgs <- orgs()

File Deployment

Deploy individual files or sets of files to multiple repositories:

# Deploy a single file
file_deploy("local/path/file.R", "remote/path/file.R", repos)

# Create a mapping of multiple files
mapping <- file_mapping(
  "local/lint.R" = ".lintr",
  "local/gitignore" = ".gitignore",
  dir = "templates/workflows",
  pattern = "\\.ya?ml$",
  target_prefix = ".github/workflows/"
)

# Create pull requests with multiple file changes
pr_create(
  repos = repos,
  branch_name = "feature/standardize-workflows",
  title = "Standardize CI workflows",
  body = "Implements organization-wide CI workflow standards",
  file_mapping = mapping
)

Dry Run Mode

Preview changes before making them:

# Preview changes without making them
file_deploy("local/file.R", "remote/file.R", repos, dry_run = TRUE)

# Preview PR creation
pr_create(repos, "branch-name", "PR Title", "PR Body", mapping, dry_run = TRUE)

License

AGPL (>= 3)

Copy Link

Version

Install

install.packages('multideploy')

Monthly Downloads

130

Version

0.1.0

License

AGPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

James Balamuta

Last Published

August 27th, 2025

Functions in multideploy (0.1.0)

file_content

Retrieve the content of a file from a GitHub repository
pr_create

Create a pull request for changes in multiple repositories
print.file_deploy_result

Print method for "file_deploy_result" objects
file_deploy

Deploy a file to multiple GitHub repositories
file_update

Create or update a file in a GitHub repository
file_mapping

Create a file mapping for multi-repository deployment
print.pr_create_result

Print method for pr_create_result objects
print.file_mapping

Print method for file_mapping objects
repos

List repositories for a user or organization
orgs

List organizations for the authenticated user
multideploy-package

This package provides functions to deploy file changes across multiple GitHub repositories using the gh package.