Compare commits
1 Commits
main
...
a778aaa57c
| Author | SHA1 | Date | |
|---|---|---|---|
| a778aaa57c |
@@ -12,20 +12,31 @@ git add pyproject.toml poetry.lock
|
|||||||
git commit -m "chore: update dependencies $(date +%Y-%m-%d)"
|
git commit -m "chore: update dependencies $(date +%Y-%m-%d)"
|
||||||
git push "https://oauth2:${CI_TOKEN}@${CI_SERVER_URL#https://}/${REPO}.git" "$BRANCH"
|
git push "https://oauth2:${CI_TOKEN}@${CI_SERVER_URL#https://}/${REPO}.git" "$BRANCH"
|
||||||
|
|
||||||
DESCRIPTION=$(cat "$SUMMARY_FILE")
|
# build the entire JSON payload in Python to avoid shell escaping issues
|
||||||
|
PAYLOAD=$(python3 - <<EOF
|
||||||
|
import json, sys
|
||||||
|
|
||||||
|
with open("${SUMMARY_FILE}") as f:
|
||||||
|
description = f.read()
|
||||||
|
|
||||||
|
payload = {
|
||||||
|
"head": "${BRANCH}",
|
||||||
|
"base": "main",
|
||||||
|
"title": "chore: dependency updates $(date +%Y-%m-%d)",
|
||||||
|
"body": description,
|
||||||
|
"assignees": [${ASSIGNEE_ID}],
|
||||||
|
}
|
||||||
|
|
||||||
|
print(json.dumps(payload))
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
HTTP_RESPONSE=$(curl --silent --show-error \
|
HTTP_RESPONSE=$(curl --silent --show-error \
|
||||||
--write-out "HTTPSTATUS:%{http_code}" \
|
--write-out "HTTPSTATUS:%{http_code}" \
|
||||||
--request POST \
|
--request POST \
|
||||||
--header "Authorization: token ${CI_TOKEN}" \
|
--header "Authorization: token ${CI_TOKEN}" \
|
||||||
--header "Content-Type: application/json" \
|
--header "Content-Type: application/json" \
|
||||||
--data "{
|
--data "$PAYLOAD" \
|
||||||
\"head\": \"${BRANCH}\",
|
|
||||||
\"base\": \"main\",
|
|
||||||
\"title\": \"chore: dependency updates $(date +%Y-%m-%d)\",
|
|
||||||
\"body\": $(echo "$DESCRIPTION" | python3 -c 'import json,sys; print(json.dumps(sys.stdin.read()))'),
|
|
||||||
\"assignee\": "${CI_ASSIGNEE_ID}"
|
|
||||||
}" \
|
|
||||||
"${CI_SERVER_URL}/api/v1/repos/${REPO}/pulls")
|
"${CI_SERVER_URL}/api/v1/repos/${REPO}/pulls")
|
||||||
|
|
||||||
HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed -e 's/HTTPSTATUS:.*//g')
|
HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed -e 's/HTTPSTATUS:.*//g')
|
||||||
|
|||||||
Reference in New Issue
Block a user