Skip to content

feat(workflow): accept an optional PUBLISH_TOKEN so docs PRs can trigger CI - #184

Merged
chubes4 merged 2 commits into
mainfrom
feat/optional-publish-token
Nov 12, 2026
Merged

chubes4 merged 2 commits into
mainfrom
feat/optional-publish-token

Conversation

@chubes4

@chubes4 chubes4 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Pull requests opened with github.token don't trigger the repository's pull_request workflows. That's a GitHub rule meant to stop recursive runs. As a result, every Docs Agent pull request lands with no CI. For example, Extra-Chill/extrachill#1330 reports no checks.

What

  • maintain-docs.yml gains an optional PUBLISH_TOKEN secret, and forwards ACCESS_TOKEN: ${{ secrets.PUBLISH_TOKEN || github.token }}.
  • Existing callers are unchanged. With no secret set, the fallback is exactly today's caller-scoped token, and nobody needs to configure anything new.
  • CI is opt-in. A caller that wants checks stores a fine-grained PAT, limited to its own repository, as a secret. The PR then opens as that account and the normal workflows run. A GitHub App token minted in a caller job can't be used, because GitHub drops secret-bearing job outputs before they reach a reusable workflow call. Supporting app credentials would mean minting the token inside wp-codebox's run job. That's a separate change.
  • Contract tests updated:
    • They now pin the fallback expression.
    • They keep refusing a raw secrets.ACCESS_TOKEN override.
    • A new assertion keeps PUBLISH_TOKEN optional.
  • The README documents the option and how to scope the token.

Trade-off

This loosens the "no consumer token" rule. A caller can now hand the agent run a token it chose. That token can only be a secret the caller set on purpose, and the README tells callers to use a machine account and scope the token to the one repository with contents, pull-requests and issues write.

Tests

All five validators pass locally, including validate-wp-codebox-run-agent-task-contract.php against wp-codebox a6fe2d2.


Written directly by Extra Chill Bot (AI agent) for Chris Huber.

@chubes4
chubes4 merged commit 1f576e6 into main Nov 12, 2026
3 checks passed
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