{"id":19372814,"url":"https://github.com/hasura/smooth-checkout-buildkite-plugin","last_synced_at":"2025-10-07T01:43:30.324Z","repository":{"id":38321742,"uuid":"391874033","full_name":"hasura/smooth-checkout-buildkite-plugin","owner":"hasura","description":"All the things you need during a Buildkite checkout :butter: :kite:","archived":false,"fork":false,"pushed_at":"2024-03-29T06:55:07.000Z","size":81,"stargazers_count":12,"open_issues_count":6,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-04-14T11:05:22.387Z","etag":null,"topics":["buildkite","buildkite-plugin","checkout","ci","git"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hasura.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}},"created_at":"2021-08-02T08:42:19.000Z","updated_at":"2024-04-06T02:41:46.000Z","dependencies_parsed_at":"2023-01-21T00:47:21.988Z","dependency_job_id":"37ecdac4-2521-4cfc-9db9-e6ea67d6fcd5","html_url":"https://github.com/hasura/smooth-checkout-buildkite-plugin","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fsmooth-checkout-buildkite-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fsmooth-checkout-buildkite-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fsmooth-checkout-buildkite-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasura%2Fsmooth-checkout-buildkite-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasura","download_url":"https://codeload.github.com/hasura/smooth-checkout-buildkite-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223929805,"owners_count":17226965,"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":["buildkite","buildkite-plugin","checkout","ci","git"],"created_at":"2024-11-10T08:25:24.031Z","updated_at":"2025-10-07T01:43:25.277Z","avatar_url":"https://github.com/hasura.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smooth Checkout\nAll the things you need during a Buildkite checkout :butter: :kite:\n\n## Usage\n\n### Repository-less builds\n```yml\nsteps:\n  - command: echo \"Skips checking out Git project in checkout\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          skip_checkout: true\n```\n\n### Checking out repo\n```yml\nsteps:\n  - command: echo \"Checks out repo at given ref\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003creponame\u003e.git\n                ref: \u003cref\u003e # (optional)\n                clone_flags: \u003cflags\u003e # (optional) flags to use with `git clone` command\n```\n\nIf `ref` is not provided the values of `BUILDKITE_BRANCH` and `BUILDKITE_COMMIT` env vars are used.\n\nAllowed values for `ref`:\n- Branch name\n- Git tag\n- Commit SHA (40 character long hash)\n\n`clone_flags` can either be a string or an array of strings.\n\n### Shallow clone\nA shallow clone can easily be done by passing the `depth` flag in the `clone_flags` field. For example:\n```yaml\nsteps:\n  - command: echo \"shallow clone repo\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n                - url: \"git@github.com:hasura/smooth-checkout-buildkite-plugin\"\n                  clone_flags: \"--depth 1\"\n```\n      \n\n### Checking out multiple repositories\nYou can checkout multiple repositories by providing multiple `config` elements:\n```yaml\nsteps:\n  - command: echo \"Checks out multiple git repositories\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003crepo_1\u003e.git\n            - config:\n              - url: https://github.com/\u003cusername\u003e/\u003crepo_2\u003e.git\n                ref: \u003cref\u003e\n```\nUnlike single repo checkouts, when checking out multiple repos, they will each be checked out in\nsubdirectories of `$BUILDKITE_BUILD_CHECKOUT_PATH` corresponding to the name of the repository\n(based on its URL). In the above example, the contents of the working directory would be `repo_1/`\nand `repo_2/`.\n\nYou can also explicitly provide the path to an ssh identity file using the `ssh_key_path` config field:\n```yaml\nsteps:\n  - command: echo \"Checks out multiple git repositories\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003crepo_1\u003e.git\n                ssh_key_path: .ssh/key_1\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003crepo_2\u003e.git\n                ref: \u003cref\u003e\n                ssh_key_path: .ssh/key_2\n```\n\nIf you are using [smooth-secrets](https://github.com/hasura/smooth-secrets-buildkite-plugin) to\nconfigure ssh keys, you can do the following to easily set the `ssh_key_path`:\n```yaml\nsteps:\n  - command: echo \"Checks out multiple git repositories\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003crepo\u003e.git\n                ssh_key_path: $$SECRETS_DIR/\u003ckey\u003e\n```\nwhere `\u003ckey\u003e` is the value of\n[`key` field](https://github.com/hasura/smooth-secrets-buildkite-plugin#key-required-string) in\nsmooth-secrets config with any `/` characters replaced by `-`.\n\n### Checking out repo from git mirrors\nYou can attempt to fetch a git repository from git mirrors and fallback to using the original\nsource repo in case of a failure while checking out from mirrors.\n```yaml\nsteps:\n  - command: echo \"Checks out repo from mirror (fall back to github in case of failure)\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          repos:\n            - config:\n              - url: git@mirror.git.interal:/path/to/git/mirror\n              - url: git@github.com:\u003cusername\u003e/\u003creponame\u003e.git\n```\n\n\n## Setup \u0026 Cleanup\nSmooth Checkout also supports setting custom directories for your jobs and deleting the checkout\ndirectory after the job completes. `BUILDKITE_BUILD_CHECKOUT_PATH` is set to the\ndirectory specified by the `build_checkout_path` option. For legacy reasons, the environment\nvariable `WORKSPACE` is also set to the same value, but its usage is deprecated.\n```yaml\nsteps:\n  - command: echo \"Checks out repo to custom directory\"\n    plugins:\n      - hasura/smooth-checkout#v4.4.1:\n          build_checkout_path: /tmp/${BUILDKITE_COMMIT}\n          delete_checkout: true\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003creponame\u003e.git\n```\n### Use custom directory with interpolation\nAdditionally, if `BUILDKITE_PIPELINE_NO_INTERPOLATION` is set to true and custom directory is an interpolation of variables (example: depends on BUILDKITE_JOB_ID, BUILDKITE_STEP_ID etc); use `interpolate_checkout_path` env to set the directory.\n\n```yaml\nsteps:\n  - command: echo \"Checks out repo to custom directory\"\n    plugins:\n      - hasura/smooth-checkout#v4.2.1:\n          interpolate_checkout_path: /tmp/${BUILD_CHECKOUT_PATH}/${BUILD_ID}\n          delete_checkout: true\n          repos:\n            - config:\n              - url: git@github.com:\u003cusername\u003e/\u003creponame\u003e.git\n```\n\n## Contributing\n  - Fork this repo and clone on your machine:\n    ```bash\n    git clone https://github.com/\u003cyour-username\u003e/smooth-checkout-buildkite-plugin\n    ```\n  - Make the required changes\n  - Run linter\n    ```bash\n    docker-compose run --rm lint\n    ```\n  - Run tests (try to add tests for any new features introduced)\n    ```bash\n    docker-compose run --rm tests\n    ```\n  - Once linter and tests run successfully, open a pull request on this repo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasura%2Fsmooth-checkout-buildkite-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasura%2Fsmooth-checkout-buildkite-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasura%2Fsmooth-checkout-buildkite-plugin/lists"}