actions / actions/checkout

Idiomatic way of specifying --single-branch argument

Open
#285 5 comments 34 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
8.9k
Forks
2.8k
PR merge metrics
No merged PRs in 30d

Description

Hello, AFAIK, the fastest way to clone just a single branch of a huge repository requires the following arguments:

git clone $REPO_URL   \
  --branch $BRANCH    \
  --depth 1           \
  --single-branch

With with: fetch-depth: 1, we get --depth 1, but I could not find a way to specify the last argument --single-branch, which skips fetching details of all branches except for the one specified by --branch (or default branch, if --branch or -b was skipped). Without --single-branch, it means "get depth 1 of all branches", and in case there are many (100+) branches, it is a sheer waste of time and resource for those who are interested in just one branch during the build (i.e. a common use-case).

Is there an idiomatic way to specify it? If not, please consider it for the future version.

Cheers!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the checkout action's available inputs and the git clone or fetch invocation it uses. Confirm whether an input can request single-branch behavior, and consider the work complete when a workflow can select that behavior and the resulting checkout avoids fetching unrelated branches.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.