diff --git a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml index e0015c3..8fe7177 100644 --- a/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml +++ b/actions/example-schedule-noncancel/.forgejo/workflows/schedule_continue.yml @@ -4,5 +4,11 @@ on: jobs: test: runs-on: docker + container: + image: code.forgejo.org/oci/debian:bookworm + options: "--volume /srv/example:/srv/example" steps: - - run: sleep 15 + - run: | + while ! [ -f /srv/example/schedule-noncancel/PUSHED ]; do + sleep 3 + done diff --git a/actions/example-schedule-noncancel/run.sh b/actions/example-schedule-noncancel/run.sh index 5d0af81..810e634 100755 --- a/actions/example-schedule-noncancel/run.sh +++ b/actions/example-schedule-noncancel/run.sh @@ -3,7 +3,9 @@ repo=root/example-$example # delete the repository # api=$url/api/v1 -forgejo-curl.sh api_json -X DELETE $api/repos/root/example-$example +if forgejo-curl.sh api_json -X GET $api/repos/root/example-$example; then + forgejo-curl.sh api_json -X DELETE $api/repos/root/example-$example +fi # # push the repository @@ -61,6 +63,10 @@ echo Push to repo again # forgejo-test-helper.sh push_workflow actions/example-echo $url root example-$example setup-forgejo $token +echo Signal to the workflow that the push has happened +mkdir -p /srv/example/schedule-noncancel +touch /srv/example/schedule-noncancel/PUSHED + # # Wait for the workflow to finish anyway # @@ -71,7 +77,7 @@ checkFinished() { "select status \ from action_run \ where id = $run_id \ - and status != 6" + and (status != 6 and status != 5)" } finished_status=$(checkFinished)