{"id":21509775,"url":"https://github.com/rynkowsg/checkout-orb","last_synced_at":"2025-03-17T15:16:05.203Z","repository":{"id":224060647,"uuid":"762277046","full_name":"rynkowsg/checkout-orb","owner":"rynkowsg","description":"Orb helping to do advanced checkouts.","archived":false,"fork":false,"pushed_at":"2024-07-06T18:38:19.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-09T03:47:52.643Z","etag":null,"topics":["circleci-orb","git-checkout","git-lfs","git-submodules"],"latest_commit_sha":null,"homepage":"https://circleci.com/developer/orbs/orb/rynkowsg/checkout-orb","language":"Shell","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/rynkowsg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-23T12:53:51.000Z","updated_at":"2024-07-06T18:38:22.000Z","dependencies_parsed_at":"2024-03-06T01:48:05.648Z","dependency_job_id":"af23da80-523c-4c1a-84ec-7129175f8b03","html_url":"https://github.com/rynkowsg/checkout-orb","commit_stats":null,"previous_names":["rynkowsg/checkout-orb"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rynkowsg%2Fcheckout-orb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rynkowsg%2Fcheckout-orb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rynkowsg%2Fcheckout-orb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rynkowsg%2Fcheckout-orb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rynkowsg","download_url":"https://codeload.github.com/rynkowsg/checkout-orb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056431,"owners_count":20390720,"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":["circleci-orb","git-checkout","git-lfs","git-submodules"],"created_at":"2024-11-23T21:31:04.080Z","updated_at":"2025-03-17T15:16:05.173Z","avatar_url":"https://github.com/rynkowsg.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [`rynkowsg/checkout`][orb-page] orb\n\n[![CircleCI Build Status][ci-build-badge]][ci-build]\n[![CircleCI Orb Version][orb-version-badge]][orb-page]\n[![License][license-badge]][license]\n[![CircleCI Community][orbs-discuss-badge]][orbs-discuss]\n\nCircleCI orb for advanced checkouts.\n\n## Motivation\n\nThe standard `checkout` command is good for basic stuff, but when you need to do more, it can get tricky.\nThis orb makes those tricky things easier.\n\nWhat it does:\n\n- Supports shallow clones, so you can\n  - grab just the latest commit if that's all you need, or\n  - get the last few commits, depending on what you need,\n  - supports smart deepen - if depth is too shallow, try 10 times to deepen.\n\n- Supports cloning to existed already repository\n  - e.g. if you persist or cache repository\n\n- Works with LFS (Large File Storage), so you can:\n  - get LFS files in your repo, or\n  - choose not to get LFS files if you don't need them.\n\n- Helps with submodules in a couple of ways:\n  - you can clone repos that have submodules,\n  - you can also clone repos without bringing along the submodules.\n\n- Lets you use your own SSH keys.\n\n- Supports running job locally on your machine.\n\n- Supports usage of GitHub token for fetching public repositories.\n\n\n## Quickstart\n\nThe simplest possible case includes replacement of `checkout` to `checkout/checkout`.\n\n```yaml\nversion: '2.1'\n\norbs:\n  checkout: rynkowsg/checkout@0.3.0\n\njobs:\n  test:\n    docker: [{image: \"cimg/base:stable\"}]\n    steps:\n      - checkout/checkout\n\nworkflows:\n  main-workflow:\n    jobs:\n      - test\n```\n\n## Usage\n\n### Shallow clone\n\n```yaml\njobs:\n  test:\n    steps:\n      - checkout/checkout:\n          depth: 1\n```\nSetting `depth: 1` will clone only the top commit whether checking out the branch or a tag.\n\n### Clone with LFS support\n\n```yaml\njobs:\n  test:\n    steps:\n      - checkout/checkout:\n          with_lfs: true\n```\n\n### Clone with submodules\n\n```yaml\njobs:\n  test:\n    steps:\n      - checkout/checkout:\n          with_submodules: true\n```\n\n### Clone additional repository\n\n```yaml\njobs:\n  test:\n    # ...\n    steps:\n      - checkout/checkout\n      - checkout/checkout:\n          repo_url: \"https://github.com/rynkowsg/test-clone-repo-l0.git\"\n          repo_branch: \"master\"\n          repo_sha1: \"f731330\"\n          dest_dir: /tmp/test-clone\n```\nIn this case, we first clone the current repository, and then additional one to given destination.\n\n\u003e **WARNING:** If the `dest_dir` is not provided, the command will fail because both will try to clone the repo to the default location `~/project`.\n\n\n### Authenticate with GitHub token\n\nIf GitHub token is available all HTTPS clones uses it.\nIt can be provided by:\n- command param `github-token` or\n- in environment variable `GITHUB_TOKEN`.\n\n### Authenticate with custom SSH identity\n\nThe SSH identity provided by default in CircleCI job allows only to fetch the current repository.\nSome scenarios when it is problematic includes:\n- when you fetch private repo other than current,\n- you employ submodules in your repository from which some are private.\n\nIn such a case you need to provide additional SSH identity with access for given repository.\nEither via CircleCI dashboard or with environment variables.\nIt can be done by providing one of two environment variables:\n- `CHECKOUT_KEY` - private key in plain text\n- `SSH_PRIVATE_KEY_B64` - private key in base64.\n\n---\n\nFor more guidelines and examples, see the [orb registry listing][orb-page].\n\n## Contributing\n\nI welcome [issues][gh-issues] to and [pull requests][gh-pulls] against this repository!\n\n## More\n\n- [troubleshooting](./docs/troubleshooting.md)\n- [testing](./docs/testing.md)\n- [todo](./docs/todo.md)\n\n## Similar projects\n\n- https://github.com/guitarrapc/git-shallow-clone-orb\n- https://github.com/issmirnov/fast-checkout-orb\n- https://github.com/vsco/advanced-checkout-orb\n\n## `rynkowsg/` orb family\n\n| Name                                                            | Description                                                                                       |\n|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| [`rynkowsg/asdf`](https://github.com/rynkowsg/asdf-orb)         | Orb providing support for ASDF                                                                    |\n| [`rynkowsg/checkout`](https://github.com/rynkowsg/checkout-orb) | Advanced checkout with support of LFS, submodules, custom SSH identities, shallow clones and more |\n| [`rynkowsg/rynkowsg`](https://github.com/rynkowsg/rynkowsg-orb) | Orb with no particular theme, used primarily for prototyping                                      |\n\n## License\n\nCopyright © 2024 Greg Rynkowski\n\nReleased under the [MIT license][license].\n\n[ci-build-badge]: https://circleci.com/gh/rynkowsg/checkout-orb.svg?style=shield \"CircleCI Build Status\"\n[ci-build]: https://circleci.com/gh/rynkowsg/checkout-orb\n[gh-issues]: https://github.com/rynkowsg/checkout-orb/issues\n[gh-pulls]: https://github.com/rynkowsg/checkout-orb/pulls\n[license-badge]: https://img.shields.io/badge/license-MIT-lightgrey.svg\n[license]: https://raw.githubusercontent.com/rynkowsg/checkout-orb/master/LICENSE\n[orb-page]: https://circleci.com/developer/orbs/orb/rynkowsg/checkout\n[orb-version-badge]: https://badges.circleci.com/orbs/rynkowsg/checkout.svg\n[orbs-discuss-badge]: https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg\n[orbs-discuss]: https://discuss.circleci.com/c/ecosystem/orbs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frynkowsg%2Fcheckout-orb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frynkowsg%2Fcheckout-orb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frynkowsg%2Fcheckout-orb/lists"}