Fix errors:
- propose only open PRs from gitea - use ssh_url - both repos should have ssh urls - exit if pull failed
This commit is contained in:
parent
3127fa2e4c
commit
8e1666b05a
|
@ -11,13 +11,13 @@ fi
|
|||
if [ -z "${2}" ]; then
|
||||
echo "No PR# specified, here is a list:"
|
||||
curl -s --request GET -u ${1} ${REPOAPIURL}/pulls \
|
||||
| jq '.[] | .number, .title' | paste - -
|
||||
| jq '.[] | select(.state == "open") | .number, .title' | paste - -
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pr=$(curl -s --request GET -u ${1} ${REPOAPIURL}/pulls/${2})
|
||||
|
||||
branch=$(echo $pr | jq '.head | (.repo.clone_url + " " + .label)' | tr -d '"')
|
||||
branch=$(echo $pr | jq '.head | (.repo.ssh_url + " " + .label)' | tr -d '"')
|
||||
title=$(echo $pr | jq '.title')
|
||||
body=$(echo $pr | jq '.body')
|
||||
|
||||
|
@ -25,7 +25,7 @@ body=$(echo $pr | jq '.body')
|
|||
echo "Merging PR ${2}"
|
||||
|
||||
git checkout -b gitea-${2} v0.6
|
||||
git pull ${branch}
|
||||
git pull ${branch} || exit 1
|
||||
git push --set-upstream origin gitea-${2}
|
||||
|
||||
if [ -z "${3}" ]; then
|
||||
|
|
Loading…
Reference in New Issue