actions / actions/checkout

`origin/HEAD` Not Present

Open
#910 5 comments 21 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

origin/HEAD is a useful ref since it refers to the default branch, which varies between repos. origin/HEAD is normally present locally, so Git scripts, hooks, etc. that work locally sometimes rely on the presence of origin/HEAD and then break in GitHub Actions. I'm not aware of an input that allows one to ensure that this useful ref is present in a checkout. As a workaround, we run git remote set-head origin --auto manually, but it would be nice to have within the action since diagnosing the issue requires considerable familiarity with Git. In particular, I find the absence of origin/HEAD when passing fetch-depth: 0 counterintuitive.

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 reviewing the checkout action's handling of fetch-depth and remote refs, then reproduce the behavior in GitHub Actions with fetch-depth: 0. Done means the action reliably provides origin/HEAD for scripts and hooks without requiring a manual git remote set-head origin --auto.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
ci-cd, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.