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