//#region src/git/commit.d.ts interface Identity { email?: string; name?: string; } interface CommitParameters { author?: Identity; committer?: Identity; dir: string; message: string; } /** * Writes a commit to the local Git repository. */ declare const commit: ({ author, committer, dir, message }: CommitParameters) => Promise; //#endregion //#region src/git/getChangedFiles.d.ts type ChangedFileState = 'added' | 'modified' | 'deleted'; interface ChangedFile { path: string; state: ChangedFileState; } interface ChangedFilesParameters { dir: string; /** * File changes to exclude from the result. * * Defaults to `[]` (no exclusions). */ ignore?: ChangedFile[]; } /** * Returns all the files which have been added, modified or deleted in the * working directory of the local Git repository since the last commit. */ declare const getChangedFiles: ({ dir, ignore }: ChangedFilesParameters) => Promise; //#endregion //#region src/git/commitAllChanges.d.ts interface CommitAllParameters { dir: string; message: string; author?: Identity; committer?: Identity; /** * File changes to exclude from the commit. * * Defaults to `[]` (no exclusions). */ ignore?: ChangedFile[]; } /** * Stages all changes and writes a commit to the local Git repository. */ declare const commitAllChanges: ({ dir, message, author, committer, ignore }: CommitAllParameters) => Promise; //#endregion //#region src/git/currentBranch.d.ts interface CurrentBranchParameters { dir?: string; env?: Record; } /** * Tries to return a Git branch name from CI environment variables, falling back * to the local Git repository when the current working `dir` is supplied. */ declare const currentBranch: ({ dir, env }?: CurrentBranchParameters) => Promise; //#endregion //#region src/git/findRoot.d.ts interface FindRootParameters { dir: string; } /** * Returns the first Git root directory encountered walking up from the provided * `dir`. */ declare const findRoot: ({ dir }: FindRootParameters) => Promise; //#endregion //#region src/git/log.d.ts interface GetHeadCommitParameters { dir: string; env?: Record; } /** * Gets the object ID of the head commit. * * This tries to extract the commit ID from common CI environment variables, * and falls back to the local Git repository log. */ declare const getHeadCommitId: ({ dir, env }: GetHeadCommitParameters) => Promise; /** * Gets the message of the head commit. * * This tries to extract the message from common CI environment variables, * and falls back to the local Git repository log. */ declare const getHeadCommitMessage: ({ dir, env }: GetHeadCommitParameters) => Promise; //#endregion //#region src/git/remote.d.ts interface GetOwnerAndRepoParameters { dir: string; env?: Record; } /** * Extracts the owner and repository names from CI environment variables, * falling back to local Git remotes. * * Currently, only GitHub repository URLs are supported: * * ```console * git@github.com:seek-oss/skuba.git * https://github.com/seek-oss/skuba.git * ``` */ declare const getOwnerAndRepo: ({ dir, env }: GetOwnerAndRepoParameters) => Promise<{ owner: string; repo: string; }>; //#endregion //#region src/git/push.d.ts /** * Use a GitHub app token to auth the Git push. * * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment * variables if `token` is not provided. */ interface GitHubAppAuth$1 { type: 'gitHubApp'; token?: string; } interface PushParameters { /** * The auth mechanism for the push. * * Currently, only GitHub app tokens are supported. */ auth: GitHubAppAuth$1; dir: string; /** * The reference to push to the remote. * * This may be a commit, branch or tag in the local repository. */ ref: string; remote?: string; /** * The destination branch or tag on the remote. * * This defaults to `ref`. */ remoteRef?: string; /** * Forcefully override any conflicts. * * This defaults to `false`. */ force?: boolean; } interface PushResult { ok: boolean; error: string | null; refs: Record; headers?: Record | undefined; } /** * Pushes the specified `ref` from the local Git repository to a remote. */ declare const push: ({ auth, dir, ref, remote, remoteRef, force }: PushParameters) => Promise; //#endregion //#region src/git/pull.d.ts /** * Use a GitHub app token to auth the Git push. * * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment * variables if `token` is not provided. */ interface GitHubAppAuth { type: 'gitHubApp'; token?: string; } interface PullParameters { /** * The auth mechanism for the push. * * Currently, only GitHub app tokens are supported. */ auth: GitHubAppAuth; dir: string; /** * The local branch to fast forward. */ ref: string; remote?: string; /** * The branch or tag on the remote to reference. * * This defaults to `ref`. */ remoteRef?: string; } /** * Fast forwards the specified `ref` on the local Git repository to match the remote branch. */ declare const fastForwardBranch: ({ auth, dir, ref, remote, remoteRef }: PullParameters) => Promise; //#endregion //#region src/git/reset.d.ts interface ResetParameters { dir: string; branch: string; commitId: string; hard?: boolean; } /** * Resets the specified branch in the local Git repository to a particular * commit. */ declare const reset: ({ dir, branch, commitId, hard }: ResetParameters) => Promise; //#endregion //#region src/git/isFileGitIgnored.d.ts declare const isFileGitIgnored: ({ absolutePath, gitRoot }: { absolutePath: string; gitRoot: string; }) => Promise; declare namespace index_d_exports { export { ChangedFile, commit, commitAllChanges, currentBranch, fastForwardBranch, findRoot, getChangedFiles, getHeadCommitId, getHeadCommitMessage, getOwnerAndRepo, isFileGitIgnored, push, reset }; } //#endregion export { push as a, getHeadCommitMessage as c, commitAllChanges as d, ChangedFile as f, fastForwardBranch as i, findRoot as l, commit as m, isFileGitIgnored as n, getOwnerAndRepo as o, getChangedFiles as p, reset as r, getHeadCommitId as s, index_d_exports as t, currentBranch as u };