фикс ранера на обновление

This commit is contained in:
denzel committed 2026-11-12 02:19:26 -05:00
1 parent 8f7ffe02a2
commit 55fd998ef2
5 files changed
+71 -17

No files matched your search

+24 -2
View File
@@ -10,11 +10,33 @@ jobs:
steps:
- name: Fetch and deploy
env:
GIT_TERMINAL_PROMPT: "0"
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
DEPLOY_SHA: ${{ gitea.sha }}
run: |
set -eu
checkout_dir=$(mktemp -d)
trap 'rm -rf -- "$checkout_dir"' EXIT
set +x
: "${GITEA_TOKEN:?Gitea job token is missing}"
umask 077
task_dir=$(mktemp -d)
trap 'rm -rf -- "$task_dir"' EXIT
checkout_dir="$task_dir/repository"
cat > "$task_dir/askpass" <<'SH'
#!/bin/sh
case "$1" in
*Username*) printf '%s\n' 'x-access-token' ;;
*Password*) printf '%s\n' "$GITEA_TOKEN" ;;
*) exit 1 ;;
esac
SH
chmod 700 "$task_dir/askpass"
export GIT_ASKPASS="$task_dir/askpass"
# Do not read/store credentials via host credential helpers.
export GIT_CONFIG_COUNT=2
export GIT_CONFIG_KEY_0=credential.helper
export GIT_CONFIG_VALUE_0=''
export GIT_CONFIG_KEY_1=http.followRedirects
export GIT_CONFIG_VALUE_1=false
git clone --branch main --single-branch \
https://sulaco.nodered.ru:5333/COD2/OKTP_SERVER.git "$checkout_dir"
cd "$checkout_dir"