1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-22 17:34:03 +03:00
gitea/services/actions
Zettat123 31a0c4dfb4
Improve the handling of jobs.<job_id>.if (#31070)
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`](517d11c671/pkg/runner/run_context.go (L739-L753)))
. 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's `if`
is empty, set the job status to `StatusSkipped`
- In other cases, the job status will be set to `StatusWaiting`, and
then act_runner will check the `if` condition and run the job if the
condition is met
2024-05-27 14:15:34 +08:00
..
auth_test.go Add interface{} to any replacement to make fmt, exclude *.pb.go (#30461) 2024-04-13 17:32:15 +00:00
auth.go Add ac claim for old docker/build-push-action@v3 / current buildx gha cache (#29584) 2024-03-05 17:34:42 +00:00
cleanup.go Expire artifacts before deleting them physically (#29241) 2024-02-18 22:25:14 +08:00
clear_tasks.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
commit_status.go Add commit status summary table to reduce query from commit status table (#30223) 2024-04-12 09:41:50 +08:00
init.go Move notification interface to services layer (#26915) 2023-09-05 18:37:47 +00:00
interface.go feat(api): enhance Actions Secrets Management API for repository (#30656) 2024-04-26 21:11:49 +08:00
job_emitter_test.go Improve the handling of jobs.<job_id>.if (#31070) 2024-05-27 14:15:34 +08:00
job_emitter.go Improve the handling of jobs.<job_id>.if (#31070) 2024-05-27 14:15:34 +08:00
notifier_helper.go Enable more revive linter rules (#30608) 2024-04-22 11:48:42 +00:00
notifier.go Fix missed doer (#30231) 2024-04-08 21:26:41 +00:00
rerun_test.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
rerun.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
schedule_tasks.go Interpolate runs-on with variables when scheduling tasks (#30640) 2024-04-23 20:55:25 +02:00
variables.go Add API for Variables (#29520) 2024-03-28 20:40:35 +00:00