Skip to content

Add automated Terminus commands/releases data update - #10177

Open
EdwardAngert wants to merge 1 commit into
pantheon-systems:mainfrom
EdwardAngert:feature/terminus-data-update-automation
Open

Add automated Terminus commands/releases data update#10177
EdwardAngert wants to merge 1 commit into
pantheon-systems:mainfrom
EdwardAngert:feature/terminus-data-update-automation

Conversation

@EdwardAngert

@EdwardAngert EdwardAngert commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

src/source/data/commands.json and terminusReleases.json (which power the <Commands /> and <Releases /> components on the Terminus docs pages) have been manually maintained and are currently stale — commands.json is three releases behind and missing real commands, terminusReleases.json stops eight releases short of current. Both files are just data dumps from the Terminus GitHub repo (a fresh terminus.phar's list --format=json output for commands, the releases API for changelog data) that already match the existing file schemas with no transform needed.

This PR adds:

  • scripts/update-terminus-data.ts — regenerates both files from live Terminus data
  • .github/workflows/update-terminus-data.yml — runs it on a schedule, on demand (workflow_dispatch), or via a repository_dispatch from a future release hook in pantheon-systems/terminus (inert until that hook exists)
  • Opens a PR only when the data actually changed (via peter-evans/create-pull-request)

This PR is the mechanism only — no data changes. It's the base of a 3-PR stack; #2 and #3 are opened against my fork for now since they depend on branches that only exist there, and will be re-targeted to this repo once this PR merges.

PR Repo Base → Head Contents
#10177 (this PR) pantheon-systems/documentation mainfeature/terminus-data-update-automation Automation mechanism (script + workflow)
#1 EdwardAngert/pantheon-documentation (fork) feature/terminus-data-update-automationchore/refresh-terminus-data Data refresh (2 commits: reformat, then content)
#2 EdwardAngert/pantheon-documentation (fork) chore/refresh-terminus-datacontent/terminus-audit-fixes Content audit fixes

How to test

The script itself — needs PHP 8.2+ locally and gh CLI authenticated (the script calls gh auth token automatically if GITHUB_TOKEN isn't set):

git checkout feature/terminus-data-update-automation
npm ci
npm run update-terminus-data
git diff --stat src/source/data/

Downloads the latest terminus.phar from GitHub releases, runs php terminus.phar list --format=json for commands.json, paginates the releases API for terminusReleases.json. Takes ~10-20 seconds. git diff should show real changes if new Terminus releases have landed since this PR's data was last generated, or a clean no-op otherwise.

The GitHub Actions workflow (exercises setup-php, setup-node, and peter-evans/create-pull-request — a separate concern from whether the script itself works):

  • Once merged (or from this branch directly): gh workflow run "Update Terminus reference data" --repo pantheon-systems/documentation --ref feature/terminus-data-update-automation, or trigger via the Actions tab UI (workflow_dispatch)
  • Locally without touching GitHub: act (brew install act) can run the workflow YAML in Docker as a dry run

Test plan

  • Ran the script locally end-to-end against the live Terminus repo — confirmed it fetches, parses, and writes both files correctly
  • Type-checked the script with tsc --noEmit --strict (zero errors)
  • Validated the workflow YAML with actionlint (zero findings)
  • Confirm the workflow runs cleanly in Actions once merged (PHP setup, permissions, PR creation)

Built with docs-agent-plugin

🤖 Generated with Claude Code

src/source/data/commands.json and terminusReleases.json (which power the
<Commands /> and <Releases /> components on the Terminus docs) have been
manually maintained and are currently stale: commands.json lags three
releases behind and is missing three real commands, terminusReleases.json
stops eight releases short of current.

Adds a script that regenerates both files directly from the Terminus
GitHub repo (a fresh terminus.phar's `list --format=json` output for
commands, the releases API for changelog data — both already match the
existing file schemas, no transform needed) and a workflow that runs it
on a schedule, on demand, or via repository_dispatch from a future
release hook in pantheon-systems/terminus, opening a PR only when the
data actually changed.

This PR adds the mechanism only. A follow-up PR applies it to refresh
the current data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wiz-inc-b08cf2810f

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations 2 Low
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 Medium 2 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@pantheon-site-integration

Copy link
Copy Markdown

Successfully created multidev environment: pr-10177

@EdwardAngert
EdwardAngert marked this pull request as ready for review July 23, 2026 18:46
@EdwardAngert
EdwardAngert requested a review from a team as a code owner July 23, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant