fix(actions): prevent bulk actions from affecting all runners (#38453) - #38457
Merged
Merged
Conversation
…ea#38453) Fix the bug in the site-admin runner bulk actions introduced by go-gitea#37869: the runner IDs are empty then all runners will be deleted. Fixes go-gitea#38449 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
lunny
approved these changes
Jul 15, 2026
wxiaoguang
enabled auto-merge (squash)
July 15, 2026 03:06
wxiaoguang
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #38453 by @dreamstarsky
Keep the selected runner IDs synchronized with the bulk action form and reject requests without valid IDs. Add integration regression tests.
This fixes a severe and destructive bug in the site-admin runner bulk actions introduced by #37869.
Before this fix, every bulk operation always affected all registered runners, regardless of which runners the administrator selected. This affected the Disable, Enable, and Delete actions. In the most serious case, selecting a single runner and confirming the bulk deletion could delete every registered runner.
The frontend populated the hidden
idsfield only once during page initialization, before any runner was selected. It was not updated when the checkbox selection changed, so bulk requests were submitted with an empty ID list.The backend then passed the empty list to
FindRunnerOptions. An emptyIDsvalue means that no ID filter is added to the database query, causing all runners to be loaded and modified.This PR:
Before
untitled.mp4
After
fixed.mp4
Fixes #38449
AI assistance disclosure: OpenAI Codex was used to assist with investigation, implementation, testing, and drafting this pull request. The changes were reviewed and manually tested by the author.