actions / actions/checkout

Is there a way to get all commit history for a single branch?

Open
#520 9 comments 59 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

I'm using this action like this (this works splendidly):

- name: Check Out Code
  uses: actions/checkout@v2
  with:
    ref: ${{ env.BRANCH }}
    fetch-depth: 0

I only need to get the entire commit history for just that one ${{ env.BRANCH }}. But using fetch-depth: 0 gets all commit history for all branches and tags, which is unnecessary in my case. Is there a way to get the entire commit history for just the branch referenced in the ref?

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 with the checkout action's handling of ref and fetch-depth, then review how Git fetches branch history versus all refs and tags. Done means the action can obtain the complete history for the requested branch without fetching unrelated branches or tags, with behavior covered by the relevant action tests or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, typescript
Domain
ci-cd
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.