fix: update manifest on master branch via Gitea API
Build and Release Plugin / release (push) Failing after 33s
Build and Release Plugin / release (push) Failing after 33s
This commit is contained in:
@@ -131,18 +131,18 @@ jobs:
|
|||||||
|
|
||||||
B64_CONTENT=$(base64 -w0 manifest.json)
|
B64_CONTENT=$(base64 -w0 manifest.json)
|
||||||
|
|
||||||
# Update on manifest branch
|
# Update on master branch
|
||||||
EXISTING_MANIFEST=$(curl -s -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/contents/manifest.json?ref=manifest")
|
EXISTING_MANIFEST=$(curl -s -H "Authorization: token $TOKEN" "$API_URL/repos/$REPO/contents/manifest.json?ref=master")
|
||||||
FILE_SHA=$(echo "$EXISTING_MANIFEST" | grep -o '"sha":"[^"]*"' | head -1 | cut -d'"' -f4)
|
FILE_SHA=$(echo "$EXISTING_MANIFEST" | grep -o '"sha":"[^"]*"' | head -1 | cut -d'"' -f4)
|
||||||
|
|
||||||
if [ -n "$FILE_SHA" ]; then
|
if [ -n "$FILE_SHA" ]; then
|
||||||
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
|
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
|
||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Update manifest.json for ${{ github.ref_name }}\", \"sha\":\"$FILE_SHA\", \"branch\":\"manifest\"}"
|
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Update manifest.json for ${{ github.ref_name }}\", \"sha\":\"$FILE_SHA\", \"branch\":\"master\"}"
|
||||||
else
|
else
|
||||||
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
|
curl -s -X PUT "$API_URL/repos/$REPO/contents/manifest.json" \
|
||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Create manifest.json for ${{ github.ref_name }}\", \"branch\":\"manifest\"}"
|
-d "{\"content\":\"$B64_CONTENT\", \"message\":\"Create manifest.json for ${{ github.ref_name }}\", \"branch\":\"master\"}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user