actions/checkout — reverse-engineered prompt
Reverse engineered prompt
Build me a GitHub Action that checks out a repository into the workflow workspace so later steps can use the code. It should work for the current repo by default, but also let me point to another repo and choose a branch, tag, or commit. I want it to support normal token auth and SSH, keep authenticated git commands working during the job, then clean up credentials afterward.
Please make the common checkout options work, like custom folder path, clean reset before fetch, shallow clone with adjustable history depth, optional tags, submodules, Git LFS, sparse checkout, and a partial clone filter. If git is missing or too old, it should still be able to download the files another way.
Also make it feel safe and production ready. Add the repo path as a safe directory, support GitHub Enterprise style server URLs, and refuse unsafe fork pull request checkouts by default for sensitive workflow triggers unless someone explicitly opts in. Include tests and the action metadata so it can be used directly in workflows. Look up current GitHub Actions docs if you need to.
Want more depth? Deep Reverse