These docs have been generated using AI. Expect inaccuracies until we remove this banner.

GitHub Integration

Connect your GitHub repository to Troy Server and automate your release process.

The workflow:

  1. You push code to GitHub
  2. You tag a release (e.g., v1.3.0)
  3. Troy Server fetches the release automatically
  4. Your users see the update in their dashboard

No manual uploads. No extra steps.

Setting Up GitHub Integration

1

Enter Your Repository

On your plugin's edit screen, find the GitHub panel:

  1. Enter your repository in the format username/repository
  2. For example: your-username/my-plugin
2

Add a Personal Access Token (Optional)

For private repositories, you'll need a GitHub Personal Access Token:

  1. Go to GitHub Settings Developer Settings Personal Access Tokens
  2. Create a new token with repo scope (for private repos) or public_repo (for public)
  3. Paste it into Troy Server's GitHub panel

For public repositories, the token is optional but helps avoid rate limits.

3

Choose Your Tag Strategy

Troy Server looks for tags that look like versions:

  • v1.0.0
  • 1.0.0
  • v1.0.0-beta
  • release-1.0.0

When you push a new tag, Troy Server can automatically fetch that release.

Automatic vs Manual Fetching

Automatic (Webhooks)

Set up a webhook to notify Troy Server when you push a tag:

  1. In GitHub, go to your repository Settings Webhooks
  2. Add a webhook pointing to your Troy Server's webhook endpoint
  3. Select "Release" events

When you publish a release, GitHub pings Troy Server, which fetches the ZIP.

Note:

Coming in a future update: One-click webhook setup directly from Troy Server's admin panel.

Manual (On-Demand)

Click Fetch Latest Release in Troy Server's admin. It checks GitHub for the latest tagged release and imports it.

This is useful for:

  • Initial imports
  • When webhooks are not an option
  • Testing the integration

Release Assets vs Source Code

Troy Server can fetch either:

  1. Release assets ZIP files you upload to a GitHub release
  2. Source code GitHub's auto-generated ZIP from your tag

If you upload a ZIP asset to your release (recommended), Troy Server uses that. Otherwise, it uses the source code archive.

Why Upload Release Assets?

The source code ZIP includes:

  • Test files
  • Documentation you don't ship
  • Development configs

A release asset lets you ship only what users need.

Tip: Use GitHub Actions to automatically build and attach a clean ZIP to each release.

Directory Structure

Troy Server expects your plugin's main file to be either:

  1. In the root of the ZIP (e.g., my-plugin.php)
  2. In a folder matching the plugin slug (e.g., my-plugin/my-plugin.php)

If your repo structure is different, build a ZIP with the correct structure before attaching it to your release.

Troubleshooting

"Repository not found"

  • Check the repository name format: username/repository
  • If private, ensure your token has repo scope
  • Verify the token hasn't expired

"No releases found"

  • Make sure you've pushed at least one tag
  • Tags must look like versions (v1.0.0, 1.0.0, etc.)
  • Go to GitHub and check that Releases exist (not just Tags)

Rate limiting

  • Add a Personal Access Token (even for public repos)
  • Tokens increase your rate limit from 60 to 5,000 requests/hour

Wrong version imported

  • Troy Server imports the highest version tag it finds
  • If you need a specific version, use Manual Fetch and specify the tag

Security Notes

  • Personal Access Tokens are encrypted in the database
  • Use fine-grained tokens with minimal scope
  • For private repos, create a token with read-only access
  • Consider creating a bot account for organizational repositories

What About GitLab or Bitbucket?

Not yet supported. If you need these integrations, open an issue on GitHub.

Next Steps