feat(actions): rebrand actions bot user and allow in branch protection whitelist #233
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The built-in actions bot user needs two changes:
1. Rebrand the actions bot user
The system actions user is currently hardcoded with upstream Gitea branding:
The [bot] suffix convention (like GitHub github-actions[bot]) should be recognized. All three bot name variants should map to the actions user:
2. Allow actions bot in branch protection whitelist
Currently, the actions bot (virtual user ID -2) cannot be added to branch protection push/merge whitelists because updateUserWhitelist() in models/git/protected_branch.go validates user IDs via GetUserByID(), which only queries the database. Since the actions user is a virtual/in-memory user, it gets silently dropped.
This means CI/CD workflows that need to push to protected branches (e.g., version bumps, release commits) cannot be whitelisted through the branch protection UI.
Proposed approach: Add a toggle (similar to existing WhitelistDeployKeys) like WhitelistActionsUser that, when enabled, automatically includes the actions bot user in the push whitelist check.
Files to modify
References
Created by @MokoBot - Claude Opus 4.6