add full checkout script

This commit is contained in:
2025-07-27 16:58:31 +02:00
parent dffb313c22
commit 085870e5d9
2 changed files with 13 additions and 1 deletions

View File

@@ -5,5 +5,5 @@ runs:
steps: steps:
- run: printenv - run: printenv
shell: bash shell: bash
- run: git init - run: checkout.sh
shell: bash shell: bash

12
checkout.sh Executable file
View File

@@ -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