check the status of the cascaded PR

This commit is contained in:
Earl Warren 2023-10-12 23:24:11 +02:00
parent 756e6eacb8
commit b0c8a634f3
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 12 additions and 12 deletions

View file

@ -77,14 +77,13 @@ function push() {
(
cd $TMPDIR/$direction
if git diff; then
log_info "nothing to push"
else
git add .
git commit -m 'cascading-pr update'
git push --force-push origin $branch
git add .
if git commit -m 'cascading-pr update'; then
git push --force origin $branch
git rev-parse HEAD > ../$direction.sha
log_info "pushed"
else
log_info "nothing to push"
fi
)
}
@ -100,19 +99,20 @@ function update() {
upsert_clone destination ${options[destination_head]} ${options[destination_clone]}
(
cd $TMPDIR/origin
ls -l $TMPDIR/destination
${options[update]} $TMPDIR/destination
)
push destination ${options[destination_clone]}
push destination ${options[destination_head]} ${options[destination_clone]}
}
function finalize_options() {
options[origin_scheme]=$(scheme ${options[origin_url]})
options[origin_host_port]=$(host_port ${options[origin_url]})
options[origin_clone]=${options[origin_scheme]}://:${options[origin_token]}@${options[origin_host_port]}/${options[origin_repo]}
options[origin_clone]=${options[origin_scheme]}://any:${options[origin_token]}@${options[origin_host_port]}/${options[origin_repo]}
options[origin_head]=$(origin_pr_head)
options[destination_scheme]=$(scheme ${options[destination_url]})
options[destination_host_port]=$(host_port ${options[destination_url]})
options[destination_clone]=${options[destination_scheme]}://:${options[destination_token]}@${options[destination_host_port]}/${options[destination_repo]}
options[destination_clone]=${options[destination_scheme]}://any:${options[destination_token]}@${options[destination_host_port]}/${options[destination_repo]}
options[destination_base]=${options[destination_branch]}
: ${options[prefix]:=${options[origin_repo]}}
options[destination_head]=${options[prefix]}-${options[origin_pr]}