gitea/models/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
..
artifact.go actions artifacts api list/download check status upload confirmed (#34273) 2025-04-28 16:31:53 +07:00
main_test.go Add unit tests for action runner token (#27670) 2023-10-19 07:24:24 +07:00
run.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
run_job.go Add endpoint deleting workflow run (#34337) 2025-05-13 19:18:13 +07:00
run_job_list.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
run_job_status_test.go Fix various trivial problems (#32861) 2024-12-17 01:15:18 +07:00
run_list.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
runner.go Fix ephemeral runner deletion (#34447) 2025-05-20 15:42:31 +07:00
runner_list.go Refactor more filterslice (#30370) 2024-04-10 04:18:41 +07:00
runner_token.go Refactor "string truncate" (#32984) 2024-12-26 11:56:03 +07:00
runner_token_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 +07:00
schedule.go Fix auto concurrency cancellation skips commit status updates (#33764) 2025-03-10 15:58:48 +07:00
schedule_list.go Avoid user does not exist error when detecting schedule actions when the commit author is an external user (#30357) 2024-04-11 15:11:32 +07:00
schedule_spec.go Use UTC as default timezone when schedule Actions cron tasks (#31742) 2024-08-01 10:02:46 +07:00
schedule_spec_list.go Small refactor to reduce unnecessary database queries and remove duplicated functions (#33779) 2025-03-04 18:25:20 +07:00
schedule_spec_test.go Fix milestone deadline and date related problems (#32339) 2024-11-05 07:46:40 +07:00
status.go Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
task.go Fix ephemeral runner deletion (#34447) 2025-05-20 15:42:31 +07:00
task_list.go Add endpoint deleting workflow run (#34337) 2025-05-13 19:18:13 +07:00
task_output.go Fix no ActionTaskOutput table waring (#28149) 2023-11-21 08:02:51 +07:00
task_step.go
tasks_version.go Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 2024-04-27 08:03:49 +07:00
utils.go Use run-name and evaluate workflow variables (#34301) 2025-05-20 02:24:10 +07:00
utils_test.go
variable.go Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +07:00