Alternative to actions/checkout that does not require node
- Shell 100%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| .editorconfig | ||
| action.yml | ||
| git-clone | ||
| README.md | ||
| renovate.json | ||
Git clone
A Forgejo Actions composite action that clones the repository of the run with git into the workspace.
It runs one POSIX sh step, so the job container needs no node and no bash, e.g. alpine/git.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: https://git.tweecore.cloud/actions/git-clone@v1.0.0
with:
depth: 0
| Input | Default | Meaning |
|---|---|---|
token |
${{ github.token }} |
token for the clone; it stays in the clone, so a later git push uses it |
ref |
${{ github.sha }} |
commit, branch or tag |
depth |
1 |
commits to fetch, 0 fetches the whole history and all tags. pull-request fetches the commits of the pull request and the tip of its base branch as refs/remotes/origin/<base>, so git rev-list HEAD --not refs/remotes/origin/<base> lists the commits of the pull request. It uses --shallow-exclude; when the server refuses that, it deepens both sides in steps of 50 commits until they have a merge base (at most 20 steps), and the clone may then hold up to 49 older commits on each side. A workflow that runs on push and pull_request can use it: runs without a pull request fetch the commit of the run at depth 1 with a notice, and have no refs/remotes/origin/<base>, so a step that lists the commits of the pull request checks GITHUB_BASE_REF first. |
sparse |
empty | space separated paths, each starting with /, for a sparse, blobless checkout |