Package 'hubCI'

Title: Toolbox for hubverse Continuous Integration
Description: Functions for setting up hubverse Continuous Integration workflows.
Authors: Anna Krystalli [aut, cre] (ORCID: <https://orcid.org/0000-0002-2378-4915>), Nicholas G. Reich [ctb] (ORCID: <https://orcid.org/0000-0003-3503-9899>), Evan L. Ray [ctb], Consortium of Infectious Disease Modeling Hubs [cph]
Maintainer: Anna Krystalli <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-09-30 13:15:57 UTC
Source: https://github.com/hubverse-org/hubCI

Help Index


Hubverse Dependabot configuration setup

Description

Sets up Dependabot for a hub that is hosted on GitHub, so that the actions used by the hub's GitHub Actions workflows are kept up to date. The configuration is hosted in repository hubverse-org/hubverse-actions under ⁠dependabot/⁠. The function creates the ⁠.github/⁠ directory if necessary and downloads the configuration to .github/dependabot.yml.

Usage

use_hub_dependabot(ref = NULL, overwrite = FALSE)

Arguments

ref

Desired Git reference, usually the name of a tag ("v0.1.0") or branch ("main", including branch names containing slashes such as "ak/my-feature/27"). Other possibilities include a commit SHA ("d1c516d") or "HEAD" (meaning "tip of remote's default branch"). If not specified, defaults to the latest published release of hubverse-org/hubverse-actions (https://github.com/hubverse-org/hubverse-actions/releases)

overwrite

Whether to replace files that already exist. If FALSE, an interactive session asks first, and a non-interactive session stops with an error.

Details

The workflows added by use_hub_github_action() reference the actions they use by major version, such as actions/checkout@v4. Minor and patch releases of those actions reach the hub with no change to the workflow. A new major version does not, so the hub stays on the old one until the workflow is edited by hand. With this configuration in place, Dependabot opens a pull request in the hub for each new major version, once a week. Dependabot reads the file from the hub's default branch, so it takes effect once committed there.

The file is written to the root of the hub, located as described in use_hub_github_action().

An existing .github/dependabot.yml is replaced when overwrite = TRUE. Otherwise an interactive session asks first, and a non-interactive session stops with an error. A hub that already uses Dependabot for another ecosystem should add the github-actions entry from the downloaded configuration to its existing file instead of replacing the file.

Value

The path of the configuration file, invisibly, or an empty character vector if an existing file was left in place. Called for the side effect of writing .github/dependabot.yml.

Examples

## Not run: 
use_hub_dependabot()

## End(Not run)

Hubverse GitHub Actions workflow setup

Description

Sets up common continuous integration (CI) workflows for a hub that is hosted on GitHub using GitHub Actions. Available workflows are hosted in repository hubverse-org/hubverse-actions The function creates the necessary directories and downloads the requested workflow .yaml file.

Usage

use_hub_github_action(name, ref = NULL, overwrite = FALSE)

Arguments

name

Name of workflow, i.e. the name of one of the workflow repository directories holding a workflow .yaml file of the same name. Asking for anything else, such as a composite action, lists the workflows a hub can add.

ref

Desired Git reference, usually the name of a tag ("v0.1.0") or branch ("main", including branch names containing slashes such as "ak/my-feature/27"). Other possibilities include a commit SHA ("d1c516d") or "HEAD" (meaning "tip of remote's default branch"). If not specified, defaults to the latest published release of hubverse-org/hubverse-actions (https://github.com/hubverse-org/hubverse-actions/releases)

overwrite

Whether to replace files that already exist. If FALSE, an interactive session asks first, and a non-interactive session stops with an error.

Details

The workflow is written to the root of the hub, i.e. the closest enclosing directory containing a ⁠hub-config/⁠ directory, falling back to the working directory if there is none within the repository you are in.

Some workflows only work as a pair, one running the checks and another posting their result, and are added together: asking for "validate-submission" also adds "validate-submission-comment".

Existing workflow files are replaced when overwrite = TRUE. Otherwise an interactive session asks once, listing them, and a non-interactive session stops with an error. Nothing is written unless every file can be, so a pair is always replaced together.

Inspired by usethis::use_github_action(), and additionally accepts branch names containing slashes, which that function truncates at the first slash.

Value

The paths of the workflow files written, invisibly, or an empty character vector if existing files were left in place. Called for the side effect of writing ⁠.github/workflows/<name>.yaml⁠.

Examples

## Not run: 
use_hub_github_action(name = "validate-submission")

## End(Not run)