gitea
gitea copied to clipboard
Improve the handling of `jobs.<job_id>.if`
Fix #25897 Fix #30322
#29464 cannot handle some complex if
conditions correctly because it only checks always()
literally. In fact, it's not easy to evaluate the if
condition on the Gitea side because evaluating it requires a series of contexts. But act_runner is able to evaluate the if
condition before running the job (for more information, see gitea/act
) . So we can use act_runner to check the if
condition.
In this PR, how to handle a blocked job depends on its needs
and if
:
- If not all jobs in
needs
completed successfully and the job'sif
is empty, set the job status toStatusSkipped
- In other cases, the job status will be set to
StatusWaiting
, and then act_runner will check theif
condition and run the job if the condition is met