{"id":27022483,"url":"https://github.com/xnaaro/gitlaw","last_synced_at":"2025-07-03T18:09:56.627Z","repository":{"id":285080926,"uuid":"956643519","full_name":"egongu90/gitlaw","owner":"egongu90","description":"GitLaw SCM policy manager as Code","archived":false,"fork":false,"pushed_at":"2025-04-22T16:06:41.000Z","size":136,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T02:26:09.470Z","etag":null,"topics":["enforcement","github","gitlab","manager","policy","scm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egongu90.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-28T15:52:00.000Z","updated_at":"2025-04-22T16:06:43.000Z","dependencies_parsed_at":"2025-04-04T16:38:56.432Z","dependency_job_id":"a240a53b-c963-41b4-addb-eca0fb66b200","html_url":"https://github.com/egongu90/gitlaw","commit_stats":null,"previous_names":["xnaaro/scm-policy","xnaaro/gitlaw","egongu90/gitlaw"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/egongu90/gitlaw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egongu90%2Fgitlaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egongu90%2Fgitlaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egongu90%2Fgitlaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egongu90%2Fgitlaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egongu90","download_url":"https://codeload.github.com/egongu90/gitlaw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egongu90%2Fgitlaw/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263376160,"owners_count":23457342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["enforcement","github","gitlab","manager","policy","scm"],"created_at":"2025-04-04T20:29:59.472Z","updated_at":"2025-07-03T18:09:56.619Z","avatar_url":"https://github.com/egongu90.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gitlaw - SCM policy as Code\n\nGitlaw is a project which aim is to manage SCMs configuration as code.\nThis means the user can configure the groups and project definition such as merge request rules, default branches, etc within a configuration file, allowing to keep a shared configuration between instances and be able to replicate along different stages of the software supply chain.\n\n\n## Installation\n\nInstall the package provided in github releases.\n\nTBD: Publish to pypi.\n\n```sh\npip install https://github.com/egongu90/gitlaw/releases/download/0.0.1/gitlaw-0.0.1-py3-none-any.whl\n```\n\n## Usage\n\n```sh\nexport GITLAW_URL=\"https://gitlab.example.com\"\nexport GITLAW_TOKEN=\"1234\"\n\ngitlaw --config config.yml\n```\n\nServer url and token can be provided as command arguments.\n\n```sh\ngitlaw --config config.yml --url https://gitlab.example.com --token \"1234\"\n```\n\n\n### Config file\n\nExample configuration file with all default values can be found at [example.yml](./examples/example.yml).\n\nNot all values need to be added to the config file, just the minimal and the paramenters to be changed/verified.\n\nYAML file support anchors, so better re-use everything as possible\n\n```yaml\n---\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n```\n\n### Examples\n\n#### Global config\n\n```yaml\norganization:\n  service:\n    can_create_group: false\n    allow_account_deletion: true\n    default_group_visibility: private\n  groups:\n    - name: Example\n      description: \"Example description\"\n```\n\n#### Disable configuration of groups or projects\n\n```yaml\norganization:\n  configure_service: true\n  configure_groups: true  \n  auto_create_groups: true\n  configure_projects: true\n  service:\n    can_create_group: false\n    allow_account_deletion: true\n    default_group_visibility: private\n  groups:\n    - name: Example\n      description: \"Example description\"\n\n```\n\n#### Group members\n\n```yaml\n---\nexample_members: \u0026example_members\n  - name: user1\n    access_level: 40\n  - name: user2\n    access_level: 30\n\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n      members: *example_members\n```\n\n#### Group policy\n\n```yaml\n---\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n      policy:\n        visibility: private\n        merge_request:\n          allow_author_approval: True\n```\n\n#### Project policy\n\n```yaml\n---\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n      projects:\n      - name: test1\n        policy:\n          visibility: \"private\"\n          merge_method: merge\n          default_branch: main\n          squash_option: default_on\n```\n\n#### branch defaults\n\n```yaml\n---\nbranch_defaults: \u0026branch_defaults\n  - name: main\n    allow_force_push: False\n    code_owner_approval_required: False\n\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n      projects:\n      - name: test1\n        policy:\n          branch: *branch_defaults\n```\n\n#### Complete example\n\n```yaml\n---\ndefault_service_policy: \u0026default_service_policy\n  can_create_group: false\n  allow_account_deletion: true\n  default_group_visibility: private\n\ndefault_group_policy: \u0026default_group_policy\n  visibility: private\n  merge_request:\n  allow_author_approval: True\n\nbranch_defaults: \u0026branch_defaults\n  - name: main\n    allow_force_push: False\n    code_owner_approval_required: False\n\ndefault_project_policy: \u0026default_project_policy\n  visibility: \"private\"\n  merge_method: merge\n  default_branch: main\n  squash_option: default_on\n  branch: *branch_defaults\n\nexample_members: \u0026example_members\n  - name: user1\n    access_level: 40\n  - name: user2\n    access_level: 30\n\norganization:\n  groups:\n    - name: Example\n      description: \"Example description\"\n      policy: *default_group_policy\n      members: *example_members\n      projects:\n      - name: test1\n        policy: *default_project_policy\n```\n\n### Command arguments\n```sh\n$ gitlaw --help\nusage: gitlaw [-h] [--url URL] [--token TOKEN] [--config CONFIG] [--scm {gitlab}] [--dry-run] [--render-config] [--render-file RENDER_FILE] [--tls-verify TLS_VERIFY]\n\nGitLaw SCM policy as code.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --url URL             Server URL to configure, defaults to environment variable GITLAW_URL.\n  --token TOKEN         Server auth token, defaults to environment variable GITLAW_TOKEN.\n  --config CONFIG       Configuration file to read values, defaults to config.yml.\n  --scm {gitlab}        SCM backend type, defaults to gitlab.\n  --dry-run             Not change values, only check for changes.\n  --render-config       Only render configuration file YAML.\n  --render-file RENDER_FILE\n                        Output file to write rendered YAML, defaults to rendered.yml.\n  --tls-verify TLS_VERIFY\n                        TLS certificate verification, defaults to True\n```\n\n## Roadmap\n\nList of expected/wanted features [roadmap.md](roadmap.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnaaro%2Fgitlaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxnaaro%2Fgitlaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxnaaro%2Fgitlaw/lists"}