Git with LFS and non-interactive token auth for Swale workflows. Backs the git-clone task.
868
Swale-built image backing the git-clone task definition. It wraps git with
Git LFS and non-interactive HTTPS token authentication, and emits the resolved
commit SHA as a task output.
alpine/git, whose tag is the Git versiongit, git-lfs, openssh-client, ca-certificatesswale (uid 1000)WORKDIR /mnt/workspace, ENTRYPOINT ["/opt/git/entrypoint.sh"]The task definition's exec.args are the git command line (e.g.
["clone", "--depth=1", "${{inputs.repository_url}}", "${{inputs.dest}}"]).
The entrypoint runs git "$@" and augments it from these inputs:
| Input env | Effect |
|---|---|
INPUT_GIT_TOKEN | Configures HTTPS credential storage so a private repo can be cloned over https://oauth2:<token>@host. Pass a secret. |
INPUT_REPOSITORY_URL | Used to derive the credential host, and as the remote when INPUT_REVISION is a commit SHA. |
INPUT_DEST | The full consumer-supplied clone path; used to locate the repo when emitting the commit_sha output, and as the repository path when INPUT_REVISION is a commit SHA. |
INPUT_REVISION | When set and the command is clone, a branch or tag is passed to the clone as --branch. A full 40-character commit SHA, which --branch refuses, is fetched at depth 1 into INPUT_DEST and checked out detached instead. |
After a successful clone, the entrypoint appends
commit_sha=<resolved HEAD SHA>
to $WORKFLOW_TASK_OUTPUT.
Each tag is the version of Git the image packages, such as 2.54.0. A
rebuild that keeps that version, to pick up a fixed base image or wrapper,
adds -r1, -r2, and so on. A tag is never reused; latest follows the
newest publish.
From the repository root:
docker build -t swaleio/git:dev images/git
Merging a change under images/git publishes the image under its next tag;
task definitions reference it by digest.
Built from images/git in the
swaleio/task-definitions repository. For how a task definition
references an image, see the
task definition reference
in the Swale documentation.
The Dockerfile and entrypoint are covered by the MIT License. Git is GPL-2.0-only and Git LFS is MIT-licensed.
This image also contains software from other projects, each under its own
license: apk list -I inside the image names every package with its version
and license. Source code for its GPL and LGPL components, Git among them:
build files at https://gitlab.alpinelinux.org/alpine/aports and upstream
sources at https://distfiles.alpinelinux.org/.
We also provide that source code on request: see
Third-party software.
docker pull swaleio/git:latest