From 8abfeb98ce9c7099b11038133fa0e2d2448a12e64ab1745b80b0de11592c2af7 Mon Sep 17 00:00:00 2001 From: Vital A Pi Date: Mon, 12 Oct 2026 11:45:26 +0300 Subject: [PATCH] breaking input changes: overhauled semantics and renamed * fetch_tags (semantics) -> extra-fetch -- now accepts arbitrary fetch args * sha -> ref -- renamed to reflect that it accepts a commit-ish object in fact * also restyled: server_url -> server-url, git_object_format -> git-object-format --- act/checkout/action.yaml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/act/checkout/action.yaml b/act/checkout/action.yaml index 7b4abb9..034254f 100644 --- a/act/checkout/action.yaml +++ b/act/checkout/action.yaml @@ -4,7 +4,7 @@ name: 'Fast minimalist working copy checkout' description: 'No tags, no history, no Node.js' inputs: - server_url: + server-url: description: 'Forgejo server URL' required: true default: ${{ forgejo.server_url }} @@ -12,25 +12,24 @@ inputs: description: 'Repository path (owner/repo)' required: true default: ${{ forgejo.repository }} - sha: - description: 'Commit SHA to checkout' + ref: + description: 'Commit-ish to checkout' required: true default: ${{ forgejo.sha }} token: description: 'Forgejo token for authentication' required: true default: ${{ forgejo.token }} - git_object_format: + 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 + extra-fetch: + description: 'Options line for additional git-fetch after all, e.g. "--unshallow"' + required: false runs: using: 'composite' @@ -42,12 +41,14 @@ runs: cd "${{ inputs.cwd }}" shopt -s dotglob rm -rf * - git init --object-format=${{ inputs.git_object_format }} -b main . - git remote add origin "${{ inputs.server_url }}/${{ inputs.repository }}.git" + git init --object-format=${{ inputs.git-object-format }} -b main . + git remote add origin "${{ inputs.server-url }}/${{ inputs.repository }}.git" 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 --config-env=http.extraheader=AH fetch --depth 2 origin "${{ inputs.ref }}" 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 + if [[ -n '${{ inputs.extra-fetch }}' ]]; then + read -r -a a1 <<< '${{ inputs.extra-fetch }}' + a2=$(printf ' %q' "${a1[@]}") + printf 'Performing git-fetch with "%s"\n' "$a2" + git --config-env=http.extraheader=AH fetch $a2 fi