actions/checkout: Usage, Inputs & Common Fixes
actions/checkout clones your repo into the runner. A few inputs solve most of its gotchas.
Almost every workflow starts with checkout. Know these inputs and you avoid the common failures.
Common inputs
| Input | What it does |
|---|---|
| fetch-depth: 0 | Full history (needed for tags, blame, some tools) |
| submodules: recursive | Check out submodules |
| token | PAT/app token for private submodules or pushes |
| ref | Check out a specific branch/tag/SHA |
Typical fixes
- Shallow-clone errors → set
fetch-depth: 0. - Private submodule auth → pass a
tokenwith access. - Detached HEAD confusion → check out an explicit
ref.
Related guides
Git "Host key verification failed" in CI - Fix known_hostsFix Git "Host key verification failed" in CI - the Git host is not in known_hosts, so SSH aborts before authe…
actions/cache: Keys, Restore Keys & Best PracticesReference for actions/cache - how cache keys and restore-keys work, what to cache per ecosystem, and how to a…