From 085870e5d9ce6074c56367569e4d713fe5e0dc36 Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sun, 27 Jul 2025 16:58:31 +0200 Subject: [PATCH] add full checkout script --- action.yml | 2 +- checkout.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 checkout.sh diff --git a/action.yml b/action.yml index 60785d5..97a7be0 100644 --- a/action.yml +++ b/action.yml @@ -5,5 +5,5 @@ runs: steps: - run: printenv shell: bash - - run: git init + - run: checkout.sh shell: bash diff --git a/checkout.sh b/checkout.sh new file mode 100755 index 0000000..4e1718a --- /dev/null +++ b/checkout.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +git init +git config --global --add safe.directory $GITHUB_WORKSPACE +git remote add origin $GITHUB_SERVER_URL/$GITHUB_REPOSITORY +git config --local http.$GITHUB_SERVER_URL/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${{ secrets.github_token }} | base64)" +git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +$GITHUB_SHA:refs/remotes/origin/$GITHUB_REF_NAME +git sparse-checkout disable +git config --local --unset-all extensions.worktreeConfig +git checkout --progress --force -B $GITHUB_REF_NAME refs/remotes/origin/$GITHUB_REF_NAME +git log -1 --format=%H +ls -lh