
Checkout
actions/checkout
Check out a Git repository at a particular version
5,200stars
1,200forks
12.5M uses
Workflowv4.1.1About
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 testInputs
repositoryRepository name with owner
Default: ${{ github.repository }}
refThe branch, tag or SHA to checkout
tokenPersonal access token (PAT)
Default: ${{ github.token }}
fetch-depthNumber of commits to fetch
Default: 1
Related Actions
Metadata
Language
TypeScript
Last Updated
1/15/2024
Latest Release
v4.1.1