{"id":15783350,"url":"https://github.com/shoekstra/repo-settings","last_synced_at":"2026-02-02T10:43:57.567Z","repository":{"id":79266394,"uuid":"203800053","full_name":"shoekstra/repo-settings","owner":"shoekstra","description":"Simple CLI to configure git repository settings.","archived":false,"fork":false,"pushed_at":"2024-12-16T02:06:11.000Z","size":305,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T14:47:09.310Z","etag":null,"topics":["gitlab"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/shoekstra.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":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-08-22T13:23:08.000Z","updated_at":"2024-10-21T22:21:29.000Z","dependencies_parsed_at":"2024-10-04T19:43:17.320Z","dependency_job_id":"1344679b-c5a9-482f-adde-98e15727b39f","html_url":"https://github.com/shoekstra/repo-settings","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/shoekstra/repo-settings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoekstra%2Frepo-settings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoekstra%2Frepo-settings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoekstra%2Frepo-settings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoekstra%2Frepo-settings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shoekstra","download_url":"https://codeload.github.com/shoekstra/repo-settings/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shoekstra%2Frepo-settings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29010602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T10:37:29.253Z","status":"ssl_error","status_checked_at":"2026-02-02T10:37:28.644Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gitlab"],"created_at":"2024-10-04T19:41:26.393Z","updated_at":"2026-02-02T10:43:57.553Z","avatar_url":"https://github.com/shoekstra.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# repo-settings \u003c!-- omit in toc --\u003e\n\nA CLI to configure repository settings across various repository hosters.\n\nCurrently supported hosters:\n\n* GitLab\n\n## Contents \u003c!-- omit in toc --\u003e\n\n- [Why?](#why)\n- [How does it work?](#how-does-it-work)\n- [Installation](#installation)\n- [Configuration](#configuration)\n  - [GitLab](#gitlab)\n    - [Project settings](#project-settings)\n      - [General](#general)\n        - [Merge Request Approvals](#merge-request-approvals)\n      - [Repository](#repository)\n        - [Protected Branches](#protected-branches)\n    - [Project integrations](#project-integrations)\n      - [Slack](#slack)\n- [Usage](#usage)\n- [Docker](#docker)\n- [Features](#features)\n  - [GitLab](#gitlab-1)\n- [Roadmap](#roadmap)\n  - [GitLab](#gitlab-2)\n- [License \u0026 Authors](#license--authors)\n\n## Why?\n\nWhen using GitLab or GitHub there are many project/repository settings you cannot set at group or organisation level.\n\nThis aims to solve that problem by letting you specify project/repository configurations in a config file and target a GitLab group or GitHub organisation and apply the config to each project/repository found.\n\n*Note*: if a configuration can be found as a group or organisation option, it will not be supported here. This ensures the scope of this tool is only to apply settings to projects or repositories that cannot be done at group or organisation level.\n\n## How does it work?\n\n`repo-settings` takes settings in a config file and applies them to projects/repositorys found under a group or organisation.\n\nIt runs a few phases per project/repository found:\n\n1. Project configuration or integration settings are stored in an object\n2. This object is copied and project configuration or integration settings from the config file are applied on top of the stored object\n3. If the original object and copied object differ, it is updated with the copied object\n\nThis means only settings in the config file are applied.\n\nTo give an example of this, if you have GitLab project with the Slack integration enabled and you have the Pipeline, Push and Tags events selected, and in your config file you only specify `pipeline` and `tags`, the Push event will not be disabled. `repo-settings` only ensures that what you have specified is configured, it does not ensure the state of a project/repository's settings or it's integration settings.\n\nIf you are looking for a way to configure all settings across your projects/repositories, and to ensure the state of these, you are better off using a [Terraform](https://www.terraform.io/) module to apply these configurations.\n\n## Installation\n\nAt some point pre-built binaries will be available. Until then you will need to build it locally.\n\nThis project uses Go modules, so a minimum version of Go 1.11 is required to build the binary.\n\n1. Clone this repository\n2. Build it: `go mod download \u0026\u0026 go mod verify \u0026\u0026 go build -o repo-settings`\n\n## Configuration\n\nCreate a (JSON or YAML) config file:\n\n```yaml\ngitlab:\n  groups:\n    - name: MyGroup\n      integrations:\n        slack:\n          active: true\n          events:\n            - merge_request\n            - pipeline\n          properties:\n            webhook: https://hooks.slack.com/services/T04...\n            username: GitLab\n```\n\nIn the case of GitLab you can also use nested groups, e.g. `MyGroup/MyNestedGroup`.\n\n### GitLab\n\nThis section details how to configure GitLab repository settings.\n\n#### Project settings\n\n##### General\n\n###### Merge Request Approvals\n\nThis section configures the \"Merge Request Approvals\" options found under \"General\" settings.\n\nExample:\n\n```YAML\ngeneral:\n  mergerequestapprovals:\n    approvalsbeforemerge: 2\n```\n\n##### Repository\n\n###### Protected Branches\n\nThis section configures the \"Protected Branches\" options found under \"Repository\" settings.\n\nWhile multiple branches can be defined, you may only set `maintainers`, `developers` or `no one` when determining who is allowed to push or merge changes; specifying group or user names is not supported at this time.\n\nExample:\n\n```YAML\nrepository:\n  protectedbranches:\n    - name: master\n      allowedtopush: maintainers\n      allowedtomerge: developers\n```\n\n#### Project integrations\n\nThe project integration settings are split into two parts, the Service section and the Integration Properties section.\n\nIn the example below, everything defined under the `slack` key are generic Service settings, whilst everything under the `properties` key are specific to the Slack integration:\n\n```YAML\nslack:\n  active: true\n  events:\n    - merge_request\n    - pipeline\n  properties:\n    webhook: https://hooks.slack.com/services/T04...\n    username: GitLab\n```\n\nAll integrations contain an `active` option, which should be set to `true` to enable the integration. As this tool does not delete/remove configurations it doesn't manage, an easy way to disable an integration is set `active` to `false`.\n\nIn most cases what changes between integration is which triggers are supported; each integration will list it's supported trigger events. That said. there are some integrations which do not support events and can only be configured by it's properties, as will be shown in their examples.\n\nGeneric Service settings for integrations:\n\n| key    | description                                                     | possible settings                                         |\n| ------ | --------------------------------------------------------------- | --------------------------------------------------------- |\n| active | Determines if an integration is enabled                         | `true`, `false`                                           |\n| events | Events that will trigger the integration, specified as an array | `[\"issues\", \"merge_request\", \"pipeline\", \"push\", \"tags\"]` |\n\n##### Slack\n\nExample:\n\n```YAML\nslack:\n  active: true\n  events:\n    - merge_request\n    - pipeline\n  properties:\n    webhook: https://hooks.slack.com/services/T04...\n    username: GitLab\n```\n\n## Usage\n\nSpecify your GitLab credentials by either exporting `GITLAB_TOKEN` and `GITLAB_URL` or using the `--gitlab-token` or `--gitlab-url` flags.\n\nDo a dry run:\n\n```bash\nrepo-settings --config config.yaml -d\n```\n\nApply your settings:\n\n```bash\nrepo-settings --config config.yaml\n```\n\n## Docker\n\nIf familiar with Docker you can use the `shoekstra/repo-settings` image, assuming you already have your variables exported locally:\n\n```bash\ndocker run -it --rm -e GITLAB_TOKEN=${GITLAB_TOKEN} -e GITLAB_URL=${GITLAB_URL} -v $(pwd):/app shoekstra/repo-settings:latest -c /app/config.yaml\n```\n\n## Features\n\n### GitLab\n\nThe following GitLab project capabilities are able to be configured:\n\n* integrations:\n  * Slack\n\n## Roadmap\n\nBelow you find planned features, as they're completed they'll move to the section above.\n\nHave a configuration or feature you'd like to see supported? Create a pull request that adds it to the list below.\n\n### GitLab\n\n* \u003cs\u003eBranch protection\u003c/s\u003e ([#6](https://github.com/shoekstra/repo-settings/pull/6))\n* \u003cs\u003eMerge request approvals\u003c/s\u003e ([#2](https://github.com/shoekstra/repo-settings/pull/2))\n* Merge request settings\n\n## License \u0026 Authors\n\n- Author: Stephen Hoekstra\n\n```text\nCopyright 2019 Stephen Hoekstra \u003cstephenhoekstra@gmail.com\u003e\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoekstra%2Frepo-settings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoekstra%2Frepo-settings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoekstra%2Frepo-settings/lists"}