diff --git a/.github/workflows/semantic-commit-message-check.yaml b/.github/workflows/semantic-commit-message-check.yaml index e796581f..096c8b1c 100644 --- a/.github/workflows/semantic-commit-message-check.yaml +++ b/.github/workflows/semantic-commit-message-check.yaml @@ -12,7 +12,7 @@ jobs: - name: Check valid types uses: gsactions/commit-message-checker@v1 with: - pattern: '^(((fix|feat|docs|style|perf|refactor|test|build|chore|ci|revert)\([\w_-]+\)))!{0,1}: .*' + pattern: '^(((fix|feat|docs|style|perf|refactor|test|build|chore|ci|revert)\([\w_-]+\)))?!?: .*' error: 'Your commit message should match one of these types (build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test) in header.' excludeDescription: 'true' excludeTitle: 'true' diff --git a/api/generated_model_repository_configuration_dto.go b/api/generated_model_repository_configuration_dto.go index 90d5dcd1..fdbc95e0 100644 --- a/api/generated_model_repository_configuration_dto.go +++ b/api/generated_model_repository_configuration_dto.go @@ -56,4 +56,6 @@ type RepositoryConfigurationDto struct { RequireSignature *ConditionReferenceDto `yaml:"requireSignature,omitempty" json:"requireSignature,omitempty"` // Control how the repository is used by GitHub Actions workflows in other repositories ActionsAccess *string `yaml:"actionsAccess,omitempty" json:"actionsAccess,omitempty"` + // Custom properties for this repository + CustomProperties map[string]interface{} `yaml:"customProperties,omitempty" json:"customProperties,omitempty"` } diff --git a/api/generated_model_repository_configuration_patch_dto.go b/api/generated_model_repository_configuration_patch_dto.go index a9b91f68..1a487c9d 100644 --- a/api/generated_model_repository_configuration_patch_dto.go +++ b/api/generated_model_repository_configuration_patch_dto.go @@ -52,4 +52,6 @@ type RepositoryConfigurationPatchDto struct { // Control how the repository is used by GitHub Actions workflows in other repositories ActionsAccess *string `yaml:"actionsAccess,omitempty" json:"actionsAccess,omitempty"` PullRequests *PullRequests `yaml:"pullRequests,omitempty" json:"pullRequests,omitempty"` + // Custom properties for this repository + CustomProperties map[string]interface{} `yaml:"customProperties,omitempty" json:"customProperties,omitempty"` } diff --git a/api/openapi-v3-spec.yaml b/api/openapi-v3-spec.yaml index cd53d5ab..17e44c77 100644 --- a/api/openapi-v3-spec.yaml +++ b/api/openapi-v3-spec.yaml @@ -2116,6 +2116,10 @@ components: - ORGANIZATION - ENTERPRISE example: NOT_ACCESSIBLE + customProperties: + description: Custom properties for this repository + type: object + additionalProperties: true RepositoryConfigurationPatchDto: description: Attributes to configure the repository. If a configuration exists there are also some configured defaults for the repository. type: object @@ -2220,6 +2224,10 @@ components: example: NOT_ACCESSIBLE pullRequests: $ref: '#/components/schemas/PullRequests' + customProperties: + description: Custom properties for this repository + type: object + additionalProperties: true MergeStrategy: type: object properties: diff --git a/internal/service/repositories/repositories.go b/internal/service/repositories/repositories.go index 9e5ed498..84884b7a 100644 --- a/internal/service/repositories/repositories.go +++ b/internal/service/repositories/repositories.go @@ -479,6 +479,20 @@ func patchConfiguration(patch *openapi.RepositoryConfigurationPatchDto, original ActionsAccess: patchStringPtr(patch.ActionsAccess, original.ActionsAccess), PullRequests: patchPullRequests(patch.PullRequests, original.PullRequests), RequireSignature: patchRequireSignature(patch.RequireSignature, original.RequireSignature), + CustomProperties: patchCustomProperties(patch.CustomProperties, original.CustomProperties), + } + } else { + return original + } +} + +func patchCustomProperties(patch map[string]interface{}, original map[string]interface{}) map[string]interface{} { + if patch != nil { + if len(patch) == 0 { + // remove + return nil + } else { + return patch } } else { return original