fix(gitea-mcp): add fix/* and other branch patterns to permissions
The branch permission check was only allowing feat/, feature/, and dev/ prefixes for write operations. This blocked PR creation from fix/* branches, forcing fallback to direct API calls. Added patterns: - fix/, bugfix/, hotfix/ - for bug fixes - chore/, refactor/ - for maintenance - docs/, test/ - for documentation and tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,13 @@ class IssueTools:
|
|||||||
return operation in ['list_issues', 'get_issue', 'get_labels', 'create_issue']
|
return operation in ['list_issues', 'get_issue', 'get_labels', 'create_issue']
|
||||||
|
|
||||||
# Development branches (full access)
|
# Development branches (full access)
|
||||||
if branch in ['development', 'develop'] or branch.startswith(('feat/', 'feature/', 'dev/')):
|
# Include all common feature/fix branch patterns
|
||||||
|
dev_prefixes = (
|
||||||
|
'feat/', 'feature/', 'dev/',
|
||||||
|
'fix/', 'bugfix/', 'hotfix/',
|
||||||
|
'chore/', 'refactor/', 'docs/', 'test/'
|
||||||
|
)
|
||||||
|
if branch in ['development', 'develop'] or branch.startswith(dev_prefixes):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Unknown branch - be restrictive
|
# Unknown branch - be restrictive
|
||||||
|
|||||||
@@ -69,7 +69,13 @@ class PullRequestTools:
|
|||||||
return operation in read_ops + ['add_pr_comment']
|
return operation in read_ops + ['add_pr_comment']
|
||||||
|
|
||||||
# Development branches (full access)
|
# Development branches (full access)
|
||||||
if branch in ['development', 'develop'] or branch.startswith(('feat/', 'feature/', 'dev/')):
|
# Include all common feature/fix branch patterns
|
||||||
|
dev_prefixes = (
|
||||||
|
'feat/', 'feature/', 'dev/',
|
||||||
|
'fix/', 'bugfix/', 'hotfix/',
|
||||||
|
'chore/', 'refactor/', 'docs/', 'test/'
|
||||||
|
)
|
||||||
|
if branch in ['development', 'develop'] or branch.startswith(dev_prefixes):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Unknown branch - be restrictive
|
# Unknown branch - be restrictive
|
||||||
|
|||||||
Reference in New Issue
Block a user