@google-cloud/release-brancher
Version:
Cut release branches
57 lines (56 loc) • 1.94 kB
TypeScript
import { Octokit } from '@octokit/rest';
interface RunnerOptions {
branchName: string;
targetTag: string;
releaseType?: string;
gitHubToken: string;
upstreamRepo: string;
upstreamOwner: string;
pullRequestTitle?: string;
}
export declare class Runner {
branchName: string;
targetTag: string;
releaseType: string | undefined;
octokit: Octokit;
upstreamRepo: string;
upstreamOwner: string;
pullRequestTitle: string | undefined;
constructor(options: RunnerOptions);
private getTargetSha;
private getBranch;
private getDefaultBranch;
/**
* Creates a branch from the tag specified at initialization.
* If the branch already exists, this is a no-op.
*
* @throws {Error} If the specified tag cannot be found.
* @returns {string} The new branch ref.
*/
createBranch(): Promise<string>;
getFileContents(path: string): Promise<string | undefined>;
updateReleasePleaseConfig(content: string): string | undefined;
updateSyncRepoSettings(content: string): string | undefined;
/**
* Opens a pull request against the default branch with updated
* release-please and sync-repo-settings configurations. If an existing
* pull request already exists, it will force-push changes to the
* existing pull request.
*
* @returns {number} The pull request number.
*/
createPullRequest(): Promise<number>;
/**
* Replace the default branch name in GitHub actions config.
*/
updateWorkflow(content: string, defaultBranch: string): string;
/**
* Opens a pull request against the new release branch with updated
* GitHub action workflows. If an existing pull request already exists,
* it will force-push changes to the existing pull request.
*
* @returns {number} The pull request number.
*/
createWorkflowPullRequest(): Promise<number>;
}
export {};