summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update-fdroid.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/update-fdroid.sh b/tools/update-fdroid.sh
index 3500348..6aeed73 100755
--- a/tools/update-fdroid.sh
+++ b/tools/update-fdroid.sh
@@ -84,12 +84,11 @@ curl -s -o /dev/null -H "PRIVATE-TOKEN: $TOKEN" -X POST \
"$API/projects/$FORK_ID/repository/branches?branch=$BRANCH&ref=$FORK_BRANCH" || true
echo "==> Writing $FILE_PATH"
-CONTENT="$(cat "$SOURCE_YAML")"
LAST_COMMIT=""
LAST_COMMIT="$(gl "$API/projects/$FORK_ID/repository/files/$FILE_PATH_ENC?ref=$BRANCH" \
| jq -r '.last_commit_id // empty' 2>/dev/null || true)"
-BODY="$(jq -n --arg b "$BRANCH" --arg c "$CONTENT" --arg m "Update RECCoon to $VERSION" \
- --arg l "$LAST_COMMIT" \
+BODY="$(jq -n --arg b "$BRANCH" --rawfile c "$SOURCE_YAML" \
+ --arg m "Update RECCoon to $VERSION" --arg l "$LAST_COMMIT" \
'{branch:$b, content:$c, commit_message:$m} + (if $l == "" then {} else {last_commit_id:$l} end)')"
if [ -n "$LAST_COMMIT" ]; then
CODE="$(curl -s -o /tmp/fdroid-file.json -w '%{http_code}' \
@@ -107,7 +106,7 @@ if [ "$CODE" != "200" ] && [ "$CODE" != "201" ]; then
fi
echo "==> Checking for an existing merge request"
-EXISTING="$(gl "$API/projects/$FORK_ID/merge_requests?source_branch=$BRANCH&state=opened" \
+EXISTING="$(gl "$API/projects/$UPSTREAM_ID/merge_requests?source_branch=$BRANCH&state=opened&author_username=$USERNAME" \
| jq -r '.[0].web_url // empty')"
if [ -n "$EXISTING" ]; then
echo " already open: $EXISTING"