Take a Source Object and Make a Branch via the GitHub API
e.g. this:
const settings = {
owner: "danger",
repo: "danger-js",
fullBranchReference: "heads/a_new_branch",
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 Reference:
import * as GitHub from "@octokit/rest"
interface RepoSettings {
owner: string
repo: string
fullBranchReference: string
message: string
}
interface FileMap {
[filename: string]: string
}
export declare const memFSToGitHubCommits: (api: GitHub, volume: MemFSVolume, settings: RepoSettings) => Promise<void>
export declare const filepathContentsMapToUpdateGitHubBranch: (
api: GitHub,
fileMap: FileMap,
settings: RepoSettings
) => Promise<void>
export declare const createTree: (
api: GitHub,
settings: RepoSettings
) => (fileMap: FileMap) => Promise<GitHub.CreateTreeResponse>
export declare const createACommit: (
api: GitHub,
settings: RepoSettings
) => (treeSha: string, parentSha: string) => Promise<GitHub.Response<GitHub.CreateCommitResponse>>
export declare const updateReference: (
api: GitHub,
settings: RepoSettings
) => (newSha: string, parentSha: string) => Promise<GitHub.Response<GitHub.UpdateReferenceResponse>>
export {}