feat(actions): rebrand actions bot user and allow in branch protection whitelist #233

Closed
opened 2026-05-30 14:55:26 +00:00 by jmiller · 0 comments
Owner

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:

  • Name: gitea-actions should be mokogitea-actions
  • FullName: Gitea Actions should be MokoGitea Actions
  • Email: teabot@gitea.io should be mokogitea-actions[bot]@mokoconsulting.tech

The [bot] suffix convention (like GitHub github-actions[bot]) should be recognized. All three bot name variants should map to the actions user:

  • github-actions[bot]
  • gitea-actions[bot]
  • mokogitea-actions[bot]

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

  • models/user/user_system.go - rebrand constants
  • models/git/protected_branch.go - add actions user whitelist support
  • Branch protection API/UI - expose the new toggle

References

  • Current workflows already use gitea-actions[bot] as git author in .mokogitea/workflows/*.yml
  • System user defined in models/user/user_system.go:36-55

Created by @MokoBot - Claude Opus 4.6

## 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: - **Name**: gitea-actions should be mokogitea-actions - **FullName**: Gitea Actions should be MokoGitea Actions - **Email**: teabot@gitea.io should be mokogitea-actions[bot]@mokoconsulting.tech The [bot] suffix convention (like GitHub github-actions[bot]) should be recognized. All three bot name variants should map to the actions user: - github-actions[bot] - gitea-actions[bot] - mokogitea-actions[bot] ### 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 - models/user/user_system.go - rebrand constants - models/git/protected_branch.go - add actions user whitelist support - Branch protection API/UI - expose the new toggle ### References - Current workflows already use gitea-actions[bot] as git author in .mokogitea/workflows/*.yml - System user defined in models/user/user_system.go:36-55 --- *Created by @MokoBot - Claude Opus 4.6*
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#233