Skip to contents

Reads buildinfo from a built site directory and compares each target's recorded source trees to the current monorepo HEAD. Optionally uses changed_files.txt (from GitHub Actions) to detect which packages are touched by the current branch.

Usage

pkd_plan_build(
  dest_dir,
  monorepo_dir = ".",
  changed_files_path = NULL,
  base_ref = "origin/master",
  head_ref = "HEAD",
  branch_only = TRUE
)

Arguments

dest_dir

Path to the built site root (contains buildinfo.yaml files).

monorepo_dir

Path to monorepo root (contains packages/ and pkgdown/). Default ".".

changed_files_path

Optional path to a text file listing changed files (one per line). If provided, overrides base_ref / head_ref comparison.

base_ref

Git ref to diff from (ignored if changed_files_path is used).

head_ref

Git ref to diff to (ignored if changed_files_path is used).

branch_only

If TRUE, build only targets changed in this branch (PR mode); if FALSE, build all outdated or changed targets (post-merge reconcile).

Value

A tibble with columns: package, package_version, outdated, changed_in_branch, build (logical), reason, source_trees (nested tibble with path, tree_id), current_trees (nested tibble with path, tree_id).