From 53d16dc9cdc8a4c824c740a42013f52840372619 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Tue, 2 Jun 2026 09:47:30 +0700 Subject: [PATCH] fix(ci): use x-access-token for git clone/pull on private repo Co-Authored-By: Claude Opus 4.8 --- .github/workflows/deploy-docker.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index 894b1b2..32b2f13 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -64,24 +64,26 @@ jobs: GHCR_USERNAME: ${{ github.actor }} GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} ENV_FILE: ${{ secrets.ENV_FILE }} + GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: host: ${{ secrets.VPS_HOST }} username: ${{ secrets.VPS_USERNAME }} key: ${{ secrets.VPS_SSH_KEY }} - envs: GHCR_USERNAME,GHCR_TOKEN,ENV_FILE + envs: GHCR_USERNAME,GHCR_TOKEN,ENV_FILE,GIT_TOKEN script: | set -eu APP_DIR=/opt/imphenbot REPO_URL=https://github.com/MythEclipse/GMW.git + AUTH_URL=https://x-access-token:${GIT_TOKEN}@github.com/MythEclipse/GMW.git if [ ! -d "$APP_DIR/.git" ]; then mkdir -p "$APP_DIR" - git clone "$REPO_URL" "$APP_DIR" + git clone "$AUTH_URL" "$APP_DIR" fi cd "$APP_DIR" - git remote set-url origin "$REPO_URL" + git remote set-url origin "$AUTH_URL" git fetch origin master git checkout master git reset --hard origin/master