Repository picker dropdown#2
Open
retlehs wants to merge 1 commit into
Open
Conversation
…/ constant overrides The Repositories tab swaps the free-text "owner/repo" input for a <select> populated from /user/repos when a PAT is configured, grouped by owner and filtered to repos not already tracked. The free-text input remains as a fallback when no PAT is set or the API call errors. The PAT can now be supplied via the GITHUB_RELEASE_POSTS_PAT PHP constant or environment variable in addition to the existing encrypted DB option. Resolution order is constant > env > DB. When supplied externally the Settings field is disabled so accidental form submits can't shadow the value. Other small changes: - New "Refresh repository list" button on the Settings tab busts the 5-minute repo-list cache via a new POST /ghrp/v1/repos/refresh endpoint. Mirrors the existing Send Test Email pattern. - New repos store the raw repo slug as the display name instead of the title-cased derivation, since the slug is what users recognize. - README documents the recommended fine-grained PAT setup. Co-Authored-By: Claude Opus 4.7 (1M context) <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
Adds a repository dropdown to the Repositories tab so you can pick from your accessible GitHub repos instead of typing
owner/repoby hand. The dropdown appears whenever a Personal Access Token is configured. If no PAT is set (or the API call fails), the original free-text input is kept as a fallback:What's new
trellis-cli) rather than a title-cased derivation (Trellis Cli)Setting the PAT outside the database
For sites that prefer not to store secrets in
wp_options, the PAT can also be supplied via:GITHUB_RELEASE_POSTS_PATdefined inwp-config.phpResolution order is constant → environment variable → encrypted database value. When the PAT is set externally, the Settings field shows the masked placeholder and is disabled.
Known limitation / possible follow-up
GitHub's
/user/reposendpoint returns every repository the user behind the token can see, not just the ones a fine-grained PAT was scoped to. There's no GitHub API a fine-grained PAT can call to get its own selected-repos list. So the dropdown can be noisier than ideal for users with access to many repositories.A natural follow-up is GitHub App support, which exposes a true allowlist via
/installation/repositories(this is the model Cloudflare and similar services use). The auth path in this PR is structured to make adding that straightforward without breaking existing PAT installs.