logo

nscloud-checkout-action

Namespace platform provides Cache Volumes feature that allows workflows to share data across invocations.

These caches can store Git repository mirrors for fast checkouts. This action uses the Namespace cache volumes to store and retrieve the git mirrors.

Git submodules are supported but not cached at the moment.

Prerequisites

The git mirrors cache volumes must be enabled in the Runner Profile, or set in runners' labels. See Caching Git Repositories

Example

jobs:
  build:
    name: Build large Git repository
 
    # If you use Runner Profiles with Git mirror caching enabled
    runs-on:
      - namespace-profile-{profile name}
 
    # Or, if you use runners labels
    runs-on:
      - nscloud-ubuntu-22.04-amd64-2x4-with-cache
      - nscloud-git-mirror-5gb
 
    steps:
      - name: Checkout with Namespace Git mirrors cache
        uses: namespacelabs/nscloud-checkout-action@v2
        with:
          fetch-depth: 10

Options

repository

string. Repository name with owner. For example, namespacelabs/foundation. Default: ${{ github.repository }}.

ref

string. The branch, tag or SHA to checkout. When checking out the repository that triggered a workflow, this defaults to the reference or SHA for that event. Otherwise, uses the default branch.

token

string. Personal access token (PAT) used to fetch the repository. Default: ${{ github.token }}.

fetch-depth

string. Number of commits to fetch. 0 indicates all history for all branches and tags. Default: 1.

path

string. Relative path under $GITHUB_WORKSPACE to place the repository.

submodules

string. Whether to checkout submodules: true to checkout submodules or recursive to recursively checkout submodules.

Only available since version v1.