Actions/actions/checkout
actions

Checkout

actions/checkout

View on GitHub

Check out a Git repository at a particular version

5,200stars
1,200forks
12.5M uses
Workflowv4.1.1

About

This action checks out your repository under $GITHUB_WORKSPACE, so your workflow can access it. Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Set fetch-depth: 0 to fetch all history for all branches and tags.

Workflow Example

name: CI
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      
      - name: Run tests
        run: npm test

Inputs

repository

Repository name with owner

Default: ${{ github.repository }}

ref

The branch, tag or SHA to checkout

token

Personal access token (PAT)

Default: ${{ github.token }}

fetch-depth

Number of commits to fetch

Default: 1

Metadata

Language

TypeScript

Last Updated

1/15/2024

Latest Release

v4.1.1