/** Everything the watch service needs to dispatch a workflow back at us. */ export interface GithubDispatchContext { /** `owner/repo`. */ repository: string; /** Git ref the dispatched workflow should run on. */ ref: string; /** Token the service dispatches with; absent when none was provided. */ token?: string; } export interface GithubContextOptions { /** * Read the token from the GitHub CLI when no environment variable supplies * one. * * Off unless asked for, and that is the whole point. Registering sends a PAT * to the watch service and creates a monitor against the repository, so the * credential has to be one the user handed over — an env var is handing it * over, reading whatever `gh` happens to be holding is not. Nearly every * developer machine has a logged-in `gh`, so defaulting this on would turn a * command that used to watch locally into one that quietly ships a token. */ useGhAuth?: boolean; } export type GithubContextResult = { success: true; context: GithubDispatchContext; } | { success: false; reason: 'no_repository' | 'no_ref' | 'undispatchable_ref'; }; /** * Work out which repo and ref a watch should dispatch. * * Prefers the Actions environment, which is authoritative when we are already * running inside the workflow being registered, and falls back to the git * remote so `--watch ` also works from a developer's machine. Best-effort: * outside a git repo with no Actions env there is simply nothing to dispatch. */ export declare function tryResolveGithubDispatchContext(options?: GithubContextOptions): GithubContextResult; /** Human-facing explanation for a failed context resolution. */ export declare function describeGithubContextFailure(reason: 'no_repository' | 'no_ref' | 'undispatchable_ref'): string; /** Hint printed when a cloud registration has no credential to hand over. */ export declare function describeMissingWatchToken(): string; /** * Pull `owner/repo` out of a git remote URL. Handles the HTTPS, SCP-style, and * ssh:// spellings git hands out, and ignores non-GitHub hosts — a watch * registration names a GitHub workflow, so anything else is not dispatchable. */ export declare function parseGithubRepository(remoteUrl: string): string | undefined; //# sourceMappingURL=github-context.d.ts.map