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:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user