test: use test branch for checkout action

This commit is contained in:
david committed 2025-12-05 15:24:44 +01:00
1 parent 5c8eab2d19
commit a20c86a155
4 files changed
+17 -6

No files matched your search

+9 -5
View File
@@ -1,7 +1,11 @@
#!/bin/sh -l
git version
[ -z "$GH_TOKEN" ] \
&& git clone --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} ./ \
|| git clone --branch ${GITHUB_REF_NAME} $(echo ${GITHUB_SERVER_URL} | sed -r "s|(https*://)|\1${GH_TOKEN}@|")/${GITHUB_REPOSITORY} ./
if [ -z "${GH_TOKEN}" ]
then
git config --global "url.${GITHUB_SERVER_URL}.insteadOf" "gitea:/"
else
git config --global url.$(echo ${GITHUB_SERVER_URL} | sed "s|://|://${GH_TOKEN}@|g").insteadOf "gitea:/"
fi
cat ~/.gitconfig
echo "git clone --branch=${GITHUB_REF_NAME} gitea://${GITHUB_REPOSITORY} ./"
git status