end-to-end/actions/example-cron/run.sh
Earl Warren b63144cb0d
always allow workflows to mount /srv/example
because it is generally useful to store informations about how the
workflow ran
2024-01-05 19:37:32 +01:00

23 lines
834 B
Bash
Executable file

forgejo-test-helper.sh push_workflow actions/example-$example $url root example-$example setup-forgejo $token
#
# Verify that creating a new branch with the same SHA as the default branch
# does not change the ref associated with the schedule
#
# See https://codeberg.org/forgejo/forgejo/pulls/1941 for more information
#
function verify_ref() {
local ref=$(sqlite3 $DIR/forgejo-work-path/forgejo.db 'select ref from action_schedule')
test "${ref##*/}" = "main"
}
verify_ref
api=$url/api/v1
forgejo-curl.sh api_json --data '{"new_branch_name":"zzzz"}' $api/repos/root/example-cron/branches
verify_ref
# cron runs once per minute, give it three minutes max before declaring failure
if ! RETRY_DELAYS="30 30 30 30 30 30" forgejo.sh retry test -f /srv/example/cron-volume/DONE ; then
cat $FORGEJO_RUNNER_LOGS
false
fi