Private
Public Access
1
0

fix(ci): replace git push with Gitea API file update

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 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 13:05:06 +01:00
parent e3359320fc
commit 4f9c73e90f

View File

@@ -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" \