Notify pantheon-systems/documentation on release - #2898
Draft
EdwardAngert wants to merge 1 commit into
Draft
Conversation
The docs repo maintains commands.json and terminusReleases.json -- reference data for the Terminus docs pages, regenerated from this repo's list --format=json output and releases API. It already polls weekly (pantheon-systems/documentation#10177), but that means up to a week of staleness after every release. Adds a step to the existing release job (right after the GitHub Release is created, so terminus.phar is actually available to download) that fires a repository_dispatch to the docs repo so it can refresh same-day instead of waiting for the next poll. Requires a DOCS_DISPATCH_TOKEN secret in this repo, scoped only to sending repository_dispatch events to pantheon-systems/documentation -- see the companion issue for that ask. Until the secret is added, the step is a harmless no-op (continue-on-error, and curl doesn't fail the job on an HTTP auth error without -f); it doesn't block or affect the rest of the release. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pantheon-systems/documentationmaintainscommands.jsonandterminusReleases.json— reference data for the Terminus docs pages (command reference, changelog), regenerated from this repo'slist --format=jsonoutput and the releases API. That data was found stale during a docs audit (three releases behind, missing real commands) and the docs repo now has automation to keep it fresh: pantheon-systems/documentation#10177.That automation polls weekly by default, which means up to a week of staleness after every Terminus release. This PR adds a step to the existing
releasejob — right after the GitHub Release is created (soterminus.pharis actually available to download) — that fires arepository_dispatchto the docs repo so it can refresh the same day instead of waiting for the next poll.Requires
A
DOCS_DISPATCH_TOKENsecret in this repo, scoped only to sendingrepository_dispatchevents topantheon-systems/documentation— see #2899 for that ask. Deliberately not linked as a closing keyword: merging this PR doesn't provision the secret, an admin has to do that separately, so this PR shouldn't auto-close that issue. This PR is safe to merge before that secret exists: the step iscontinue-on-error: true, andcurlwithout-fdoesn't fail on an HTTP auth error, so it's a harmless no-op until the secret is added.Alternative design considered: push the data directly instead of notifying
This PR has terminus notify the docs repo, which then re-fetches
terminus.pharand the releases API itself to regenerate its own files. An alternative would have terminus's release job writecommands.json/terminusReleases.jsondirectly (it already buildsterminus.pharin this same job, so no re-download needed) and open the PR againstpantheon-systems/documentationitself, instead of just dispatching a notification.Went with notify-only for now, but the case for it is thinner than it might look, worth a reviewer's judgment call rather than treating as settled:
documentation'smain— neither lets this repo push tomaindirectly. Acontents: writetoken scoped todocumentationwould be needed either way (GitHub'sdispatchesendpoint itself currently requires that same permission on a fine-grained PAT, even for a notify-only token), so the permission grant isn't meaningfully narrower in the notify-only design; what differs is that this step's code path is a single fixed API call with no attacker-influenceable payload, vs. a push built from job output. A minor hardening, not a structural one.documentation's two file paths. Given both files are verbatim passthroughs (this repo's ownlist --format=jsonoutput and the raw GitHub releases response, no transform), that's not much schema knowledge to duplicate — a path, not a data model.documentation's workflow currently re-downloadsterminus.pharfrom the public release right after this job already built the same file as an artifact. Pushing directly would skip that round-trip.If a maintainer here would rather own the push logic directly, that's a reasonable call and I can rework this PR for it — flagging now rather than assuming the current split is the only reasonable shape.
Test plan
actionlint— no new findings (one pre-existing shellcheck warning at line 42, unrelated to this change)releasejob's conditions (startsWith(github.ref, 'refs/tags/') && github.repository == 'pantheon-systems/terminus') — no new gating neededpantheon-systems/documentation's workflow once the token secret is added (that workflow already listens forrepository_dispatch: types: [terminus-release])Built with docs-agent-plugin
🤖 Generated with Claude Code