Automattic / Automattic/docs-agent

Forward base_ref to WP Codebox publication config

Open Beginner friendly
#156 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Problem

Docs Agent accepts `base_ref` and uses it for recipe metadata and workspace materialization, but omits the corresponding `base` field from the `runner_workspace` JSON passed to WP Codebox. WP Codebox therefore applies its generic `main` fallback during publication.

This breaks consumers whose base branch is not `main`. Build with WordPress uses `trunk`; after all integrity and verification gates pass, publication fails with:

```text
GitHub API GET /git/ref/heads/main failed with 404.
```

Acceptance evidence: https://github.com/Automattic/build-with-wordpress/actions/runs/29645661510

## Root cause

`.github/workflows/maintain-docs.yml` builds runner workspace JSON with `from: ("origin/" + $baseRef)` but no `base: $baseRef`. WP Codebox publication reads `config.base || config.base_branch || "main"`, so clone/materialization and publication disagree.

## Acceptance criteria

1. Include `base: $baseRef` in the emitted runner workspace config.
2. Add deterministic contract coverage proving a non-main `base_ref` reaches both `base` and `from`.
3. Keep the generic WP Codebox fallback unchanged.
4. Build with WordPress manual PR-required maintenance publishes against `trunk`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in .github/workflows/maintain-docs.yml, where the runner workspace JSON is built from base_ref. Find the existing contract coverage and extend it to verify that a non-main base_ref reaches both base and from. Confirm the generic WP Codebox fallback remains unchanged and that the workflow publishes against trunk.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
ci-cd
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.