From 4f9c73e90fc3a17affa38c09fd0aee36a9b70833 Mon Sep 17 00:00:00 2001 From: SilverLABS Date: Sun, 5 Apr 2026 13:05:06 +0100 Subject: [PATCH] fix(ci): replace git push with Gitea API file update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git push over HTTPS was failing auth despite correct credentials. Use PUT /contents API instead — same token already works for releases. Co-Authored-By: Claude Sonnet 4.6 --- codemagic.yaml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/codemagic.yaml b/codemagic.yaml index dec9068..d762322 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -64,13 +64,16 @@ workflows: altstore-source.json > altstore-source.tmp.json mv altstore-source.tmp.json altstore-source.json - # Commit and push updated source - git remote set-url origin "https://SilverLABS:$GITEA_TOKEN@git.silverlabs.uk/$GITEA_REPO.git" - git config user.name "Codemagic" - git config user.email "ci@silverlabs.uk" - git add altstore-source.json - git commit -m "chore(altstore): update source for $TAG" || echo "No changes" - git push origin HEAD:main + # Update altstore-source.json via Gitea API (avoids git push auth) + FILE_SHA=$(curl -sf \ + -H "Authorization: token $GITEA_TOKEN" \ + "$GITEA_API/repos/$GITEA_REPO/contents/altstore-source.json" \ + | jq -r '.sha') + CONTENT=$(base64 altstore-source.json | tr -d '\n') + curl -sf -X PUT "$GITEA_API/repos/$GITEA_REPO/contents/altstore-source.json" \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"message\":\"chore(altstore): update source for $TAG\",\"content\":\"$CONTENT\",\"sha\":\"$FILE_SHA\",\"branch\":\"main\"}" # Create Gitea release RELEASE_ID=$(curl -sf -X POST "$GITEA_API/repos/$GITEA_REPO/releases" \