Backport #35783Fix#35780, fix#35782
Rerunning a job or a run is only allowed when the job is done and the
run is done.
Related PR: #3497098ff7d0773/routers/web/repo/actions/view.go (L239)
We don't need to check run status again in `rerunJob` because the run
status has been changed before `rerunJob`.
---
In fact, the bug described in the above issues will not occur on the
main branch. Because `getRunJobs` is called before updating the run.
98ff7d0773/routers/web/repo/actions/view.go (L425-L435)
So the run status that `rerunJob` checks is the old status.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>