gitea/services/actions
ChristopherHX cda90eca31
Add workflow_run api + webhook (#33964)
Implements 
- https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#list-jobs-for-a-workflow-run--code-samples
- https://docs.github.com/en/rest/actions/workflow-jobs?apiVersion=2022-11-28#get-a-job-for-a-workflow-run--code-samples
- https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#list-workflow-runs-for-a-repository
- https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#get-a-workflow-run
  - `/actions/runs` for global + user + org (Gitea only)
  - `/actions/jobs` for global + user + org + repository (Gitea only)
  - workflow_run webhook + action trigger
    - limitations
- workflow id is assigned to a string, this may result into problems in
strongly typed clients

Fixes
- workflow_job webhook url to no longer contain the `runs/<run>` part to
align with api
- workflow instance does now use it's name inside the file instead of
filename if set

Refactoring
- Moved a lot of logic from workflows/workflow_job into a shared module
used by both webhook and api

TODO
- [x] Verify Keda Compatibility
- [x] Edit Webhook API bug is resolved
 
Closes https://github.com/go-gitea/gitea/issues/23670
Closes https://github.com/go-gitea/gitea/issues/23796
Closes https://github.com/go-gitea/gitea/issues/24898
Replaces https://github.com/go-gitea/gitea/pull/28047 and is much more
complete

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-06-20 20:14:00 +07:00
..
auth.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
auth_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 +07:00
cleanup.go Fix ephemeral runner deletion (#34447) 2025-05-20 15:42:31 +07:00
clear_tasks.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
commit_status.go Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +07:00
context.go Fix possible panic (#34508) 2025-05-22 12:59:42 +07:00
context_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +07:00
init.go Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946) 2024-12-23 09:59:16 +07:00
init_test.go Move some Actions related functions from `routers` to `services` (#33280) 2025-01-15 21:34:30 +07:00
interface.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
job_emitter.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
job_emitter_test.go Improve the handling of `jobs.<job_id>.if` (#31070) 2024-05-27 14:15:34 +07:00
notifier.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
notifier_helper.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
rerun.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +07:00
rerun_test.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +07:00
schedule_tasks.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
task.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
variables.go Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +07:00
workflow.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00