GRM-25: feat: auto-delete branch after merge in configure_repo script
CI / lint (push) Has been cancelled
CI / unit-tests (push) Has been cancelled
CI / molecule-tests (push) Has been cancelled
Post-merge Vikunja update / vikunja (push) Has been cancelled

This commit was merged in pull request #3.
This commit is contained in:
2026-06-19 21:46:45 +00:00
parent d949bd3444
commit 9c51c8b62c
8 changed files with 72 additions and 15 deletions
+7
View File
@@ -53,6 +53,13 @@ class GiteaClient:
raise APIError(status, message) from e
return response
# -- repo settings --
def update_repo_settings(self, settings: dict[str, Any]) -> dict[str, Any]:
"""Update repository settings (e.g. auto-delete branch after merge)."""
r = self._request("PATCH", "", json=settings)
return r.json()
# -- branch protection --
def list_branch_protections(self) -> list[dict[str, Any]]:
+4
View File
@@ -37,3 +37,7 @@ LABEL_CONFIG: dict[str, object] = {
"color": "2ecc71",
"description": "Auto-merge PR when all CI checks pass",
}
REPO_SETTINGS_CONFIG: dict[str, object] = {
"default_delete_branch_after_merge": True,
}
+14
View File
@@ -586,6 +586,20 @@ TRANSLATIONS: dict[str, dict[str, str]] = {
"ru": "Конфигурация репозитория завершена.",
"zh": "仓库配置完成。",
},
"Configuring repository settings...": {
"en": "Configuring repository settings...",
"bg": "Конфигуриране на настройките на хранилището...",
"de": "Repository-Einstellungen konfigurieren...",
"ru": "Настройка параметров репозитория...",
"zh": "正在配置仓库设置...",
},
" - Auto-delete branch after merge: yes": {
"en": " - Auto-delete branch after merge: yes",
"bg": " - Автоматично изтриване на клон след сливане: да",
"de": " - Branch nach Merge automatisch löschen: ja",
"ru": " - Автоудаление ветки после слияния: да",
"zh": " - 合并后自动删除分支: 是",
},
"HTTP {status} Forbidden — your token lacks admin rights.\nMake sure the token belongs to a repo owner or organisation admin.\nAlternatively, configure branch protection manually in Settings → Branches.": { # noqa: E501
"en": "HTTP {status} Forbidden — your token lacks admin rights.\nMake sure the token belongs to a repo owner or organisation admin.\nAlternatively, configure branch protection manually in Settings → Branches.", # noqa: E501
"bg": "HTTP {status} Забранено — вашият токен няма администраторски права.\nУверете се, че токенът принадлежи на собственик на хранилище или администратор на организация.\nАлтернативно, конфигурирайте защитата на клона ръчно в Настройки → Клонове.", # noqa: E501