-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduled Gitea Actions sometimes run on non-default merged branches #28157
Comments
Hello, I can confirm that I have the same situation. Gitea 1.21.2. It was also a merge-and-delete. Now the action runs each time according to the schedule and indeed does not find the deleted branch then of course. Have you found a way to stop it from running? For me, the schedule for my master branch even stopped running and now it's only the "deleted" branch that triggers according the schedule. It's like it took it's place somehow. |
This comment was marked as spam.
This comment was marked as spam.
Hmm, it seems that it needs a complete fix (The Gitea forks don't seem having the proper fix either). If I understand correctly, maybe the root problem is that the "deleted" branch shouldn't trigger the schedule action? I haven't looked into the problem, maybe someone who have written&reviewed the code could help to figure out. Correct me if I am wrong. |
yes that is indeed the case, the deleted branch is triggering the schedule action, and not the default branch which is "master" in my case. |
I pushed again to "master" branch, directly, without a pull request, and now my schedule ran from the master branch again, and the "deleted" one was not run, so that is a workaround it seems. But I hope I don't have the problem again for every pull request 🤞 |
I'm working on this issue. |
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.
Fix go-gitea#28157 This PR fix the possible bugs about actions schedule. - 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.
Fix #28157 Backport #28691 This PR fix the possible bugs about actions schedule. - 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.
Fix go-gitea#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.
Fix go-gitea#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.
Description
Scheduled Gitea Actions are supposed to run on the default branch of the containing repository, but sometimes they run on branches that aren't the default. I haven't done enough testing to narrow down the circumstances, but it has so far always been a merged-and-deleted branch.
Given a workflow file like this:
If you create that in the default branch, it will run in the default branch as scheduled. However, once you create a PR and merge it (with branch auto-deletion turned on) it will start running the schedule on the deleted branch instead.
I've created a repository on try.gitea.io, but the screenshots are from my own instance.
Gitea Version
1.21.0
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
Git Version
No response
Operating System
No response
How are you running Gitea?
Official Helm chart v9.5.1
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: