Git and code hosts
Functions of the tools module at v0.3.2. Each returns what a command runs in; import it with import * as tools from "tools".
git
Git, configured by its parameters.
git(
--name: String | Null = null,
--email: String | Null = null,
--token: String | Null = <secret>,
--host: String = "github.com",
--token_user: String = "x-access-token",
--ssh_dir: String | Null = null,
--ssh_agent_socket: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is built from lib/images/unix/Dockerfile, as for unix(), so it takes no --image, and lask sync builds it. The container sees none of the host's Git configuration: the identity, a token for https and an SSH identity are given here, and the mounted project is trusted (safe.directory).
Parameters
--nameGIT_AUTHOR_NAME and GIT_COMMITTER_NAME.--emailGIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL.--token!!An access token for https; masked in the command log. See git_setup.--hostThe host the token is for.--token_userThe user name the host expects beside a token.--ssh_dirHost directory mounted read-only at /root/.ssh; see ssh_setup.--ssh_agent_socketHost path of an SSH agent socket (SSH_AUTH_SOCK); see ssh_setup.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "git" } on ... or $[...].
Image recipe lib/images/unix/Dockerfile
Command words bzip2, curl, envsubst, gzip, jq, openssl, rsync, tar, unzip, wget, xz, yq, zip: import command { "bzip2", "curl", "envsubst", "gzip", "jq", "openssl", "rsync", "tar", "unzip", "wget", "xz", "yq", "zip" } from "tools"
lask eval git --name "CI" --email ci@example.comgh
The GitHub CLI, configured by its parameters.
gh(
--token: String | Null = <secret>,
--host: String | Null = null,
--repo: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is that of unix(), as for git. gh never prompts, checks for no update, and pages nothing (GH_PROMPT_DISABLED=1, GH_NO_UPDATE_NOTIFIER=1, GH_PAGER=""). The token authenticates gh's own API calls; a command that also runs git over https — gh pr checkout, gh repo clone — takes with = [git_setup(token = ...)] as well.
Parameters
--token!!GH_TOKEN; masked in the command log.--hostGH_HOST, for GitHub Enterprise Server.--repoGH_REPO, "owner/name": the repository a command acts on when it is not the project's.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "gh" } on ... or $[...].
Image recipe lib/images/unix/Dockerfile
Command words bzip2, curl, envsubst, gzip, jq, openssl, rsync, tar, unzip, wget, xz, yq, zip: import command { "bzip2", "curl", "envsubst", "gzip", "jq", "openssl", "rsync", "tar", "unzip", "wget", "xz", "yq", "zip" } from "tools"
lask eval gh --repo lask-task-runner/laskglab
The GitLab CLI, configured by its parameters.
glab(
--token: String | Null = <secret>,
--host: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is that of unix(), as for git. glab checks for no update and never prompts (GLAB_CHECK_UPDATE=false, GLAB_NO_PROMPT=true). As with gh, a command that runs git over https takes git_setup as well, with token_user = "oauth2".
Parameters
--token!!GITLAB_TOKEN; masked in the command log.--hostGITLAB_HOST, for a self-managed instance.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "glab" } on ... or $[...].
Image recipe lib/images/unix/Dockerfile
Command words bzip2, curl, envsubst, gzip, jq, openssl, rsync, tar, unzip, wget, xz, yq, zip: import command { "bzip2", "curl", "envsubst", "gzip", "jq", "openssl", "rsync", "tar", "unzip", "wget", "xz", "yq", "zip" } from "tools"
lask eval glab --host gitlab.example.com