[英]How to commit file to github using REST API for CI integration
我想通過 REST API 將 my.apk 文件發送到 github 存儲庫。
文件正在轉換為 base64 並作為 blob 發送:
BLOB_SHA=$(curl -X POST https://api.github.com/repos/{user}/{repo}/git/blobs -H "Accept: application/vnd.github.v3.raw+json" -H "Authorization: Basic {token}" -d '{"content":{my app in base64},"encoding":"utf-8|base64"}' | jq '.sha')
但這里有一條消息:
bash: /mingw64/bin/curl: Argument list too long
我試圖實現的是:在 Codemagic 上構建 apk,將 apk 發送到 github,觸發 appium 測試自動化。
也許還有其他連接 Codemagic 構建和 appium 測試的可能性?
在構建 apk 之后,使用 Codemagic 運行 Appium 測試可能會更好。 在這種情況下,您不需要將任何二進制文件提交回存儲庫。 檢查此鏈接以查看如何運行 Appium 測試的示例 https://docs.codemagic.io/yaml-testing/testing/#react-native-integration-tests-using-appium-and-emulator
但是,如果您仍然想提交文件,您可以只使用git
命令,但請確保您具有寫入權限(例如查看此鏈接https://docs.codemagic.io/knowledge-base/add-a-git-tag-with-應用程序版本/ )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.