1
0
Fork 0
mirror of https://code.forgejo.org/actions/cascading-pr synced 2025-03-14 22:36:58 +01:00

wait until the repository is updated when pushing

as it indicates the push event was processed

Fixes: https://code.forgejo.org/actions/cascading-pr/issues/13
This commit is contained in:
Earl Warren 2023-12-23 18:32:49 +01:00
parent 9b5272e49c
commit 4a063913d4
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -33,6 +33,13 @@ function default_branch() {
jq --raw-output .default_branch < $TMPDIR/$direction.json
}
function updated_at() {
local direction=$1
repo_curl ${options[${direction}_repo]} api_json ${options[${direction}_api]} > $TMPDIR/$direction.json
jq --raw-output .updated_at < $TMPDIR/$direction.json
}
function exists_branch() {
local direction=$1
@ -218,8 +225,10 @@ function push() {
cd $TMPDIR/$direction
git add .
if git commit -m 'cascading-pr update'; then
local updated_at=$(updated_at $direction)
git push --force ${remote} prbranch:$branch
git rev-parse HEAD > ../$direction.sha
retry test "$updated_at" != "$(updated_at $direction)"
log_info "pushed"
else
log_info "nothing to push"