gitea/services/context
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
..
upload Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
access_log.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
access_log_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
api.go Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
api_org.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
api_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 +07:00
base.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
base_form.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
base_path.go Clarify path param naming (#32969) 2024-12-24 13:47:45 +07:00
base_test.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
captcha.go Refactor template & test related code (#32938) 2024-12-22 15:33:19 +07:00
context.go Add endpoint deleting workflow run (#34337) 2025-05-13 19:18:13 +07:00
context_cookie.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
context_model.go Refactor context repository (#33202) 2025-01-12 03:39:46 +07:00
context_request.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
context_response.go Do not show 500 error when default branch doesn't exist (#34096) 2025-04-01 21:39:00 +07:00
context_template.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
context_test.go Refactor request context (#32956) 2024-12-24 11:43:57 +07:00
csrf.go Refactor CSRF token (#32216) 2024-10-10 03:48:21 +07:00
org.go Fix team permission (#34128) 2025-04-08 04:15:15 +07:00
package.go Add a config option to block "expensive" pages for anonymous users (#34024) 2025-03-30 05:26:19 +07:00
pagination.go Only use prev and next buttons for pagination on user dashboard (#33981) 2025-03-23 19:52:43 +07:00
permission.go Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
private.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +07:00
repo.go Improve the performance when detecting the file editable (#34653) 2025-06-12 18:12:45 +07:00
response.go Remove duplicate "ResponseWriter.Status" method (#33346) 2025-01-22 06:37:52 +07:00
user.go Refactor error system (#33626) 2025-02-17 12:41:03 +07:00
utils.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
xsrf.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00
xsrf_test.go Move context from modules to services (#29440) 2024-02-27 08:12:22 +07:00