From b27f04579656e94090cae467b754c62005bf89ba Mon Sep 17 00:00:00 2001 From: Ketan Patel Date: Fri, 19 Jun 2026 19:07:32 -0400 Subject: [PATCH] Align Gitea workflow checkout with existing deploy --- .gitea/workflows/build-and-deploy.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/build-and-deploy.yml b/.gitea/workflows/build-and-deploy.yml index daa6c40..43829ad 100644 --- a/.gitea/workflows/build-and-deploy.yml +++ b/.gitea/workflows/build-and-deploy.yml @@ -21,25 +21,13 @@ jobs: - name: Checkout shell: bash env: - GITEA_SSH_PRIVATE_KEY: ${{ secrets.GITEA_SSH_PRIVATE_KEY }} - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} + GITEA_TOKEN: ${{ github.token }} run: | git init . - checkout_key="${GITEA_SSH_PRIVATE_KEY:-${SSH_PRIVATE_KEY:-${DEPLOY_KEY:-}}}" - if [[ -z "$checkout_key" ]]; then - echo "::error::No global SSH checkout key found. Configure GITEA_SSH_PRIVATE_KEY, SSH_PRIVATE_KEY, or DEPLOY_KEY." - exit 1 - fi - mkdir -p ~/.ssh - chmod 700 ~/.ssh - printf '%s\n' "$checkout_key" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - ssh-keyscan -p 2222 git.k2patel.in >> ~/.ssh/known_hosts - chmod 600 ~/.ssh/known_hosts - git remote add origin "ssh://git@git.k2patel.in:2222/k2patel/apcupsd-client.git" - GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519 -o IdentitiesOnly=yes" \ - git -c protocol.version=2 fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main + git remote add origin "https://git.k2patel.in/k2patel/apcupsd-client.git" + AUTH_HEADER="$(printf 'x-access-token:%s' "$GITEA_TOKEN" | base64 -w 0)" + git config --local "http.https://git.k2patel.in/.extraheader" "AUTHORIZATION: basic ${AUTH_HEADER}" + git -c protocol.version=2 fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main git checkout --force refs/remotes/origin/main - name: Determine image tag