commit 8a523c418341ab0502e20e4927281d24a6ffddcc Author: yigid balaban Date: Fri Aug 15 19:13:51 2025 +0300 Add action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..a606a03 --- /dev/null +++ b/action.yml @@ -0,0 +1,25 @@ +name: checkout +description: Node-free checkout for Gitea Actions using preinstalled git. +inputs: + ref: + description: Branch, tag, or commit to fetch (defaults to current workflow commit) + required: false + default: "" +runs: + using: composite + steps: + - shell: sh + env: + TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + REF: ${{ inputs.ref || github.sha }} + SERVER_URL: ${{ github.server_url }} + run: | + set -euo pipefail + BASE="${SERVER_URL:-${GITEA_SERVER_URL:-}}" + [ -n "$BASE" ] || { echo "Missing server_url"; exit 1; } + git init "$GITHUB_WORKSPACE" + cd "$GITHUB_WORKSPACE" + git remote add origin "${BASE%/}/${REPO}.git" + git -c http.extraHeader="Authorization: token $TOKEN" fetch --depth=1 origin "$REF" + git checkout FETCH_HEAD