gitea/routers/web
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
..
admin Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
auth Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
devtest Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
events Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
explore Fix remaining issues after `gopls modernize` formatting (#34771) 2025-06-18 11:37:49 +07:00
feed feat(api): add date range filtering to commit retrieval endpoints (#34497) 2025-05-19 18:57:58 +07:00
healthcheck
misc Fix various problems (#34708) 2025-06-12 09:19:24 +07:00
org Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
repo Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
shared when using rules to delete packages, remove unclean bugs (#34632) 2025-06-18 04:47:49 +07:00
user Refactor packages (func name & UI) (#34773) 2025-06-18 19:04:24 +07:00
base.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
githttp.go Fix git client accessing renamed repo (#34034) 2025-03-28 07:28:58 +07:00
goget.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
home.go Do not mutate incoming options to SearchRepositoryByName (#34553) 2025-06-02 17:33:25 +07:00
metrics.go
nodeinfo.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
passkey.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
swagger_json.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
web.go Fix some package registry problems (#34759) 2025-06-19 00:32:43 +07:00
webfinger.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00