From 7fda4264f4d0a0e980647f3f2917f81571bd5f23ab98c026017266baa6a05a16 Mon Sep 17 00:00:00 2001 From: Vital A Pi Date: Sun, 11 Oct 2026 13:39:25 +0300 Subject: [PATCH] new args: * target/working directory; * fetch tags on demand --- act/checkout/action.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/act/checkout/action.yaml b/act/checkout/action.yaml index 763f732..7b4abb9 100644 --- a/act/checkout/action.yaml +++ b/act/checkout/action.yaml @@ -23,6 +23,14 @@ inputs: git_object_format: required: true default: sha256 + cwd: + description: 'Create and change working dir before checkout' + required: true + default: '.' + fetch_tags: + description: 'Fetch tags after all' + required: true + default: false runs: using: 'composite' @@ -30,6 +38,8 @@ runs: - name: Run git checkout commands shell: bash run: | + mkdir -vp "${{ inputs.cwd }}" + cd "${{ inputs.cwd }}" shopt -s dotglob rm -rf * git init --object-format=${{ inputs.git_object_format }} -b main . @@ -37,3 +47,7 @@ runs: export AH="Authorization: Basic $(printf 'x-access-token:${{ inputs.token }}' | base64 | tr -d '\n')" git --config-env=http.extraheader=AH fetch --depth 2 origin "${{ inputs.sha }}" git reset --hard FETCH_HEAD + if [ ${{ inputs.fetch_tags }} == 'true' ]; then + printf 'Fetching tags, as requested\n' + git --config-env=http.extraheader=AH fetch --tags + fi