Checkout: Repository cloning action for workflows
Clones repositories to workflows with configurable authentication and fetch depth.
Learn more about Checkout
Checkout is a GitHub Actions action that retrieves repository code and makes it available to workflow jobs. It clones the target repository under the $GITHUB_WORKSPACE directory and configures authentication credentials for authenticated git operations. The action supports multiple authentication methods including personal access tokens and SSH keys, with configurable fetch depth to control history retrieval. It falls back to REST API downloads when Git 2.18 or higher is unavailable, and manages credential lifecycle through post-job cleanup.
Configurable Fetch Depth
Supports shallow clones (single commit default) or full history retrieval via fetch-depth parameter. Workflows optimize CI speed by fetching minimal history or access complete git operations when needed.
Persistent Authentication Methods
Accepts personal access tokens, SSH keys, or GitHub's default token with automatic credential persistence in git config. Enables authenticated git commands throughout the workflow without repeated credential setup.
Automatic REST Fallback
Falls back to REST API downloads when Git 2.18+ is unavailable in PATH. Ensures repository access across diverse runner environments without requiring specific Git versions.
# .github/workflows/ci.yml
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: npm testMinor improvements to git user-agent orchestration tracking and tag handling with annotation preservation.
- –Add orchestrationid to git user-agent when ACTIONSORCHESTRATION_ID is set
- –Fix tag handling: preserve annotations and explicit fetch-tags
Documentation updates and worktree support improvements for the v6 release.
- –Update all references from v5 and v4 to v6
- –Add worktree support for persist-credentials includeIf
- –Clarify v6 README
Major release with Node.js 24 support and enhanced credential persistence to separate files.
- –Update README to include Node.js 24 support details and requirements
- –Persist creds to a separate file
Top in Cloud & DevOps
Related Repositories
Discover similar tools and frameworks used by developers
Podman
Daemonless OCI container management with Docker-compatible CLI and rootless execution support.
Self-Hosting Guide
Guide for self-hosted software, infrastructure, networking, and automation tools.
Upload Artifact
Store workflow files as versioned zip artifacts.
ProxmoxVE
Bash scripts for automated Proxmox LXC/VM provisioning.
Kubespray
Production-grade Kubernetes deployment via Ansible playbooks.