{"id":18265304,"url":"https://github.com/exafunction/checkout","last_synced_at":"2025-04-09T01:43:06.392Z","repository":{"id":226836399,"uuid":"769763234","full_name":"Exafunction/checkout","owner":"Exafunction","description":"Internal fork of https://github.com/actions/checkout","archived":false,"fork":false,"pushed_at":"2024-11-12T19:22:15.000Z","size":2487,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-14T19:54:47.438Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Exafunction.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-10T01:34:22.000Z","updated_at":"2024-03-10T01:46:28.000Z","dependencies_parsed_at":"2024-03-10T02:46:49.809Z","dependency_job_id":"906856b0-ecaa-4e74-a95d-085538025bd1","html_url":"https://github.com/Exafunction/checkout","commit_stats":null,"previous_names":["exafunction/checkout"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exafunction%2Fcheckout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exafunction%2Fcheckout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exafunction%2Fcheckout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Exafunction%2Fcheckout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Exafunction","download_url":"https://codeload.github.com/Exafunction/checkout/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247958710,"owners_count":21024821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:17:46.350Z","updated_at":"2025-04-09T01:43:06.373Z","avatar_url":"https://github.com/Exafunction.png","language":"TypeScript","readme":"[![Build and Test](https://github.com/actions/checkout/actions/workflows/test.yml/badge.svg)](https://github.com/actions/checkout/actions/workflows/test.yml)\n\n# Checkout V4\n\nThis action checks-out your repository under `$GITHUB_WORKSPACE`, so your workflow can access it.\n\nOnly 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. Refer [here](https://docs.github.com/actions/using-workflows/events-that-trigger-workflows) to learn which commit `$GITHUB_SHA` points to for different events.\n\nThe auth token is persisted in the local git config. This enables your scripts to run authenticated git commands. The token is removed during post-job cleanup. Set `persist-credentials: false` to opt-out.\n\nWhen Git 2.18 or higher is not in your PATH, falls back to the REST API to download the files.\n\n# What's new\n\nPlease refer to the [release page](https://github.com/actions/checkout/releases/latest) for the latest release notes.\n\n# Usage\n\n\u003c!-- start usage --\u003e\n```yaml\n- uses: actions/checkout@v4\n  with:\n    # Repository name with owner. For example, actions/checkout\n    # Default: ${{ github.repository }}\n    repository: ''\n\n    # The branch, tag or SHA to checkout. When checking out the repository that\n    # triggered a workflow, this defaults to the reference or SHA for that event.\n    # Otherwise, uses the default branch.\n    ref: ''\n\n    # Personal access token (PAT) used to fetch the repository. The PAT is configured\n    # with the local git config, which enables your scripts to run authenticated git\n    # commands. The post-job step removes the PAT.\n    #\n    # We recommend using a service account with the least permissions necessary. Also\n    # when generating a new PAT, select the least scopes necessary.\n    #\n    # [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)\n    #\n    # Default: ${{ github.token }}\n    token: ''\n\n    # SSH key used to fetch the repository. The SSH key is configured with the local\n    # git config, which enables your scripts to run authenticated git commands. The\n    # post-job step removes the SSH key.\n    #\n    # We recommend using a service account with the least permissions necessary.\n    #\n    # [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)\n    ssh-key: ''\n\n    # Known hosts in addition to the user and global host key database. The public SSH\n    # keys for a host may be obtained using the utility `ssh-keyscan`. For example,\n    # `ssh-keyscan github.com`. The public key for github.com is always implicitly\n    # added.\n    ssh-known-hosts: ''\n\n    # Whether to perform strict host key checking. When true, adds the options\n    # `StrictHostKeyChecking=yes` and `CheckHostIP=no` to the SSH command line. Use\n    # the input `ssh-known-hosts` to configure additional hosts.\n    # Default: true\n    ssh-strict: ''\n\n    # Whether to configure the token or SSH key with the local git config\n    # Default: true\n    persist-credentials: ''\n\n    # Relative path under $GITHUB_WORKSPACE to place the repository\n    path: ''\n\n    # Whether to execute `git clean -ffdx \u0026\u0026 git reset --hard HEAD` before fetching\n    # Default: true\n    clean: ''\n\n    # Partially clone against a given filter. Overrides sparse-checkout if set.\n    # Default: null\n    filter: ''\n\n    # Do a sparse checkout on given patterns. Each pattern should be separated with\n    # new lines.\n    # Default: null\n    sparse-checkout: ''\n\n    # Specifies whether to use cone-mode when doing a sparse checkout.\n    # Default: true\n    sparse-checkout-cone-mode: ''\n\n    # Number of commits to fetch. 0 indicates all history for all branches and tags.\n    # Default: 1\n    fetch-depth: ''\n\n    # Whether to fetch tags, even if fetch-depth \u003e 0.\n    # Default: false\n    fetch-tags: ''\n\n    # Whether to show progress status output when fetching.\n    # Default: true\n    show-progress: ''\n\n    # Whether to download Git-LFS files\n    # Default: false\n    lfs: ''\n\n    # Whether to checkout submodules: `true` to checkout submodules or `recursive` to\n    # recursively checkout submodules.\n    #\n    # When the `ssh-key` input is not provided, SSH URLs beginning with\n    # `git@github.com:` are converted to HTTPS.\n    #\n    # Default: false\n    submodules: ''\n\n    # Add repository path as safe.directory for Git global config by running `git\n    # config --global --add safe.directory \u003cpath\u003e`\n    # Default: true\n    set-safe-directory: ''\n\n    # The base URL for the GitHub instance that you are trying to clone from, will use\n    # environment defaults to fetch from the same instance that the workflow is\n    # running from unless specified. Example URLs are https://github.com or\n    # https://my-ghes-server.example.com\n    github-server-url: ''\n```\n\u003c!-- end usage --\u003e\n\n# Scenarios\n\n- [Fetch only the root files](#Fetch-only-the-root-files)\n- [Fetch only the root files and `.github` and `src` folder](#Fetch-only-the-root-files-and-github-and-src-folder)\n- [Fetch only a single file](#Fetch-only-a-single-file)\n- [Fetch all history for all tags and branches](#Fetch-all-history-for-all-tags-and-branches)\n- [Checkout a different branch](#Checkout-a-different-branch)\n- [Checkout HEAD^](#Checkout-HEAD)\n- [Checkout multiple repos (side by side)](#Checkout-multiple-repos-side-by-side)\n- [Checkout multiple repos (nested)](#Checkout-multiple-repos-nested)\n- [Checkout multiple repos (private)](#Checkout-multiple-repos-private)\n- [Checkout pull request HEAD commit instead of merge commit](#Checkout-pull-request-HEAD-commit-instead-of-merge-commit)\n- [Checkout pull request on closed event](#Checkout-pull-request-on-closed-event)\n- [Push a commit using the built-in token](#Push-a-commit-using-the-built-in-token)\n\n## Fetch only the root files\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    sparse-checkout: .\n```\n\n## Fetch only the root files and `.github` and `src` folder\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    sparse-checkout: |\n      .github\n      src\n```\n\n## Fetch only a single file\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    sparse-checkout: |\n      README.md\n    sparse-checkout-cone-mode: false\n```\n\n## Fetch all history for all tags and branches\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    fetch-depth: 0\n```\n\n## Checkout a different branch\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    ref: my-branch\n```\n\n## Checkout HEAD^\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    fetch-depth: 2\n- run: git checkout HEAD^\n```\n\n## Checkout multiple repos (side by side)\n\n```yaml\n- name: Checkout\n  uses: actions/checkout@v4\n  with:\n    path: main\n\n- name: Checkout tools repo\n  uses: actions/checkout@v4\n  with:\n    repository: my-org/my-tools\n    path: my-tools\n```\n\u003e - If your secondary repository is private you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private)\n\n## Checkout multiple repos (nested)\n\n```yaml\n- name: Checkout\n  uses: actions/checkout@v4\n\n- name: Checkout tools repo\n  uses: actions/checkout@v4\n  with:\n    repository: my-org/my-tools\n    path: my-tools\n```\n\u003e - If your secondary repository is private you will need to add the option noted in [Checkout multiple repos (private)](#Checkout-multiple-repos-private)\n\n## Checkout multiple repos (private)\n\n```yaml\n- name: Checkout\n  uses: actions/checkout@v4\n  with:\n    path: main\n\n- name: Checkout private tools\n  uses: actions/checkout@v4\n  with:\n    repository: my-org/my-private-tools\n    token: ${{ secrets.GH_PAT }} # `GH_PAT` is a secret that contains your PAT\n    path: my-tools\n```\n\n\u003e - `${{ github.token }}` is scoped to the current repository, so if you want to checkout a different repository that is private you will need to provide your own [PAT](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line).\n\n\n## Checkout pull request HEAD commit instead of merge commit\n\n```yaml\n- uses: actions/checkout@v4\n  with:\n    ref: ${{ github.event.pull_request.head.sha }}\n```\n\n## Checkout pull request on closed event\n\n```yaml\non:\n  pull_request:\n    branches: [main]\n    types: [opened, synchronize, closed]\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n```\n\n## Push a commit using the built-in token\n\n```yaml\non: push\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - run: |\n          date \u003e generated.txt\n          git config user.name github-actions\n          git config user.email github-actions@github.com\n          git add .\n          git commit -m \"generated\"\n          git push\n```\n\n# License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexafunction%2Fcheckout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexafunction%2Fcheckout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexafunction%2Fcheckout/lists"}