The Railyard GitHub App is shared by every Railyard org, so an installation on a
repository proved nothing about who was linking it: any org could start
railyard link for a repository the App was installed on (for example all of a
GitHub organization's repositories), get a link to its own org, open the
workflow pull request there, and, once the workflow was on the default branch,
receive that repository's code on every push in its own Cloudflare account.
The browser half now has the user sign in with the App (its user authorization,
no click after the first time) and checks with that user's own token that they
can push to the repository before anything is recorded or opened. The token is
used once and never stored. go and the setup URL no longer skip to Cloudflare or
the pull request. Needs GITHUB_APP_CLIENT_ID and GITHUB_APP_CLIENT_SECRET (the
manifest command stores them) and the App callback URL, which the manifest sets.
Tests first: an attacker org with read-only GitHub access is refused, claims no
installation and opens no pull request; forged codes and a refused sign-in fail.
Console 129/129, tsc clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>