Skip to content
Snippets Groups Projects
Commit 5771f504 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

Forget about assignee for a minute and try to generate the body

parent 5db35a12
No related branches found
No related tags found
3 merge requests!319update production,!311bump nixpkgs version,!305Automate updating nixpkgs pin in develop branch once a week
Pipeline #2343 failed
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nixUnstable git openssh curl
#!nix-shell -i bash -p nixUnstable git openssh curl python3
# ^^
# we get nixUnstable for the diff-closures command, mostly.
......@@ -58,21 +58,22 @@ if git diff --exit-code origin/develop...; then
fi
# nix-build -A morph -o result-after
# diff=$(nix --extra-experimental-features nix-command store diff-closures ./result-before/ ./result-after/)
# DIFF=$(nix --extra-experimental-features nix-command store diff-closures ./result-before/ ./result-after/)
DIFF="Hello world"
git commit -am "bump nixpkgs version"
git push --force origin "${TARGET_BRANCH}:${TARGET_BRANCH}"
BODY=$(cat <<EOF
{
"id": ${CI_PROJECT_ID},
"source_branch": "${CI_COMMIT_REF_NAME}",
"target_branch": "${TARGET_BRANCH}",
"remove_source_branch": true,
"title": "WIP: ${CI_COMMIT_REF_NAME}",
"assignee_id":"jcalderone"
}
EOF
)
curl -X POST --data "${BODY}" --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${UPDATE_NIXPKGS_PRIVATE_TOKEN}" "https://${HOST}/api/v4/projects/${CI_PROJECT_ID}/merge_requests"
BODY=$(python3 -c '
import os, sys, json
print(json.dumps({
"id": os.environ["CI_PROJECT_ID"],
"source_branch": os.environ["CI_COMMIT_REF_NAME"],
"target_branch": os.environ["TARGET_BRANCH"],
"remove_source_branch": True,
"title": f"WIP: {os.environ["CI_COMMIT_REF_NAME"]}",
"description": sys.argv[1],
}))
' "${DIFF}")
echo curl -X POST --data "${BODY}" --header "Content-Type: application/json" --header "PRIVATE-TOKEN: ${UPDATE_NIXPKGS_PRIVATE_TOKEN}" "https://${HOST}/api/v4/projects/${CI_PROJECT_ID}/merge_requests"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment