Giteabot
c4a1ff7d16
Fix scheduled action panic with null event payload ( #37459 ) ( #37466 )
...
Backport #37459 by cyphercodes
This fixes the scheduled action panic when an event payload is JSON
`null` by initializing the payload map before adding `schedule`. It also
adds regression coverage for the null-payload case.
Fixes #37447 .
Co-authored-by: Rayan Salhab <r.salhab@aiyexpertsolutions.com >
Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com >
Co-authored-by: Hermes Agent (GPT-5.5) <hermes-agent@users.noreply.github.com >
Co-authored-by: Nicolas <bircni@icloud.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com >
2026-04-28 05:07:26 +00:00
Giteabot
0916039c2a
Add event.schedule context for schedule actions task ( #37320 ) ( #37348 )
...
Backport #37320 by @lunny
Fix #35452
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com >
2026-04-21 21:45:12 +00:00
ChristopherHX
2401812b76
Cleanup ActionRun creation ( #35624 )
...
Closes #35622
---------
Signed-off-by: ChristopherHX <christopher.homberger@web.de >
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: delvh <dev.lh@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-10-12 12:23:37 +00:00
Zettat123
40f71bcd4c
Support Actions concurrency syntax ( #32751 )
...
Fix #24769
Fix #32662
Fix #33260
Depends on https://gitea.com/gitea/act/pulls/124
-
https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency
## ⚠️ BREAKING ⚠️
This PR removes the auto-cancellation feature added by #25716 . Users
need to manually add `concurrency` to workflows to control concurrent
workflows or jobs.
---------
Signed-off-by: Zettat123 <zettat123@gmail.com >
Co-authored-by: Christopher Homberger <christopher.homberger@web.de >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2025-10-10 18:58:55 +00:00
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 +08:00
ChristopherHX
651ef66966
Add workflow_job webhook ( #33694 )
...
Provide external Integration information about the Queue lossly based on
https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job
Naming conflicts between GitHub & Gitea are here, Blocked => Waiting,
Waiting => Queued
Rationale Enhancement for ephemeral runners management #33570
2025-03-11 10:40:38 -07:00
ChristopherHX
a92d5f65ce
Fix auto concurrency cancellation skips commit status updates ( #33764 )
...
* add missing commit status
* conflicts with concurrency support
Closes #33763
Co-authored-by: Giteabot <teabot@gitea.io >
2025-03-10 15:58:48 -07:00
sillyguodong
2f6b1c46a1
Interpolate runs-on with variables when scheduling tasks ( #30640 )
...
Follow #29468
1. Interpolate runs-on with variables when scheduling tasks.
2. The `GetVariablesOfRun` function will check if the `Repo` of the run
is nil.
---------
Co-authored-by: Giteabot <teabot@gitea.io >
2024-04-23 20:55:25 +02:00
Zettat123
1ef2eb50d8
Remove scheduled action tasks if the repo is archived ( #30224 )
...
Fix #30220
2024-04-01 13:48:14 +00:00
Jason Song
b150ff0bab
Cancel previous runs of the same PR automatically ( #29961 )
...
Follow #25716 . Also cancel previous runs for `pull_request_sync`.
It's not a bug since it original PR said "if the event is push".
The main change is
https://github.com/go-gitea/gitea/pull/29961/files#diff-08adda3f8ae0360937f46abb1f4418603bd3518522baa356be11c6c7ac4abcc3 .
And also rename `CancelRunningJobs` to `CancelPreviousJobs` to make it
more clear.
2024-03-21 15:01:35 +08:00
Zettat123
adc3598a75
Fix an actions schedule bug ( #28942 )
...
In #28691 , schedule plans will be deleted when a repo's actions unit is
disabled. But when the unit is enabled, the schedule plans won't be
created again.
This PR fixes the bug. The schedule plans will be created again when the
actions unit is re-enabled
2024-01-31 14:55:12 +00:00
Lunny Xiao
97292da960
Fix schedule tasks bugs ( #28691 )
...
Fix #28157
This PR fix the possible bugs about actions schedule.
## The Changes
- Move `UpdateRepositoryUnit` and `SetRepoDefaultBranch` from models to
service layer
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when actions unit has been disabled
or global disabled.
- Remove schedules plan from database and cancel waiting & running
schedules tasks in this repository when default branch changed.
2024-01-12 21:50:38 +00:00
JakobDev
ebe803e514
Penultimate round of db.DefaultContext refactor ( #27414 )
...
Part of #27065
---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-10-11 04:24:07 +00:00
Lunny Xiao
9c0a3532a4
Add a new column schedule_id for action_run to track ( #26975 )
...
Fix #26971
And the UI now will display it's scheduled but not triggered by a push.
<img width="954" alt="图片"
src="https://github.com/go-gitea/gitea/assets/81045/d211845c-457e-4c3e-af1f-a0d654d3f365 ">
2023-09-08 23:01:19 +08:00
Lunny Xiao
d1dca38a2a
Fix schedule actions still running even if workflow disalbed ( #26939 )
...
Fix #26782
2023-09-07 10:25:46 +08:00
Lunny Xiao
0d55f64e6c
chore(actions): support cron schedule task ( #26655 )
...
Replace #22751
1. only support the default branch in the repository setting.
2. autoload schedule data from the schedule table after starting the
service.
3. support specific syntax like `@yearly`, `@monthly`, `@weekly`,
`@daily`, `@hourly`
## How to use
See the [GitHub Actions
document](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule )
for getting more detailed information.
```yaml
on:
schedule:
- cron: '30 5 * * 1,3'
- cron: '30 5 * * 2,4'
jobs:
test_schedule:
runs-on: ubuntu-latest
steps:
- name: Not on Monday or Wednesday
if: github.event.schedule != '30 5 * * 1,3'
run: echo "This step will be skipped on Monday and Wednesday"
- name: Every time
run: echo "This step will always run"
```
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com >
---------
Co-authored-by: Jason Song <i@wolfogre.com >
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-08-24 03:06:51 +00:00