Take a Source Object and Make a Branch via the GitHub API
e.g. this:
const settings = {
owner: "danger",
repo: "danger-js",
fullBranchReference: "heads/new_readme",
message: "Adds some new stuff"
}
await filepathContentsMapToUpdateGitHubBranch(api, { "README.md": "### My README" }, settings)
and it will make a branch on that repo with those new file contents.
Full API Reference
export interface BranchCreationConfig {
owner: string
repo: string
fullBaseBranch?: string
fullBranchReference: string
message: string
}
interface FileMap {
[filename: string]: string
}
export declare const memFSToGitHubCommits: (
api: GitHub,
volume: MemFSVolume,
settings: BranchCreationConfig
) => Promise<void>
export declare const filepathContentsMapToUpdateGitHubBranch: (
api: GitHub,
fileMap: FileMap,
settings: BranchCreationConfig
) => Promise<void>
export declare const createTree: (
api: GitHub,
settings: BranchCreationConfig
) => (fileMap: FileMap, baseSha: string) => Promise<GitHub.GitdataCreateTreeResponse>
export declare const createACommit: (
api: GitHub,
settings: BranchCreationConfig
) => (treeSha: string, parentSha: string) => Promise<GitHub.Response<GitHub.GitdataCreateCommitResponse>>
export declare const updateReference: (
api: GitHub,
settings: BranchCreationConfig
) => (newSha: string) => Promise<GitHub.Response<GitHub.GitdataCreateReferenceResponse>>
export {}