{"id":33526232,"url":"https://github.com/ecosyste-ms/octorule","last_synced_at":"2025-11-26T12:04:07.911Z","repository":{"id":323903487,"uuid":"1095052261","full_name":"ecosyste-ms/octorule","owner":"ecosyste-ms","description":"Enforce GitHub repository settings across your organization","archived":false,"fork":false,"pushed_at":"2025-11-12T17:48:40.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T05:25:57.516Z","etag":null,"topics":["admin","github","github-config","settings"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/octorule","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ecosyste-ms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"ecosystems","github":"andrew"}},"created_at":"2025-11-12T14:26:04.000Z","updated_at":"2025-11-12T17:48:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ecosyste-ms/octorule","commit_stats":null,"previous_names":["ecosyste-ms/octorule"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ecosyste-ms/octorule","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecosyste-ms%2Foctorule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecosyste-ms%2Foctorule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecosyste-ms%2Foctorule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecosyste-ms%2Foctorule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecosyste-ms","download_url":"https://codeload.github.com/ecosyste-ms/octorule/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecosyste-ms%2Foctorule/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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","status":"online","status_checked_at":"2025-11-26T02:00:06.075Z","response_time":193,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["admin","github","github-config","settings"],"created_at":"2025-11-26T12:04:02.354Z","updated_at":"2025-11-26T12:04:06.933Z","avatar_url":"https://github.com/ecosyste-ms.png","language":"Ruby","funding_links":["https://opencollective.com/ecosystems","https://github.com/sponsors/andrew"],"categories":[],"sub_categories":[],"readme":"# Octorule\n\n[![Gem Version](https://badge.fury.io/rb/octorule.svg)](https://badge.fury.io/rb/octorule)\n\nA command-line tool to enforce and synchronize GitHub repository settings across your organization.\n\n## Features\n\n- Synchronize repository settings across all repositories in an organization\n- Manage repository collaborators and their roles\n- Configure branch protection rules\n- Synchronize file contents from local files to repositories\n- Customizable settings via JSON file\n- Filter repositories by name pattern, labels, or language\n- Supports pagination for organizations with many repositories\n- Detailed logging of operations\n- Support for GitHub Enterprise via custom base URL\n- Dry-run mode to preview changes\n\n## Prerequisites\n\n- Ruby 3.2 or higher\n- GitHub Personal Access Token with `repo` and `admin:org` scopes\n\n## Installation\n\nInstall the gem:\n\n```bash\ngem install octorule\n```\n\n## Usage\n\nRun the tool using:\n\n```bash\noctorule --org my-org --settings settings.json [options]\n```\n\n### Command Line Arguments\n\nRequired Arguments:\n\n- `-o, --org \u003corganization\u003e`: GitHub organization name\n- `-s, --settings \u003cpath\u003e`: Path to JSON file with repository settings\n\nAuthentication Options:\n\n- `-t, --token \u003ctoken\u003e`: GitHub Personal Access Token (overrides GITHUB_TOKEN env var)\n- `-u, --base-url \u003curl\u003e`: GitHub API base URL (for GitHub Enterprise)\n\nFilter Options:\n\n- `-n, --name-pattern \u003cpattern\u003e`: Regular expression pattern to match repository names to include\n- `-l, --label \u003clabel\u003e`: Only process repositories that have this label\n- `--language \u003clanguage\u003e`: Only process repositories with this primary language\n- `--fork`: Only process repositories that are forks\n- `--no-fork`: Only process repositories that aren't forks\n\nOther Options:\n\n- `-d, --dry-run`: Show what would be changed without making changes\n- `-h, --help`: Show help message\n- `-v, --version`: Show version\n\n### Examples\n\n```bash\n# Basic usage with environment variables\nexport GITHUB_TOKEN=ghp_xxxxxxxxxxxx\noctorule --org my-org --settings settings.json\n\n# Using CLI token instead of environment variable\noctorule --org my-org --settings settings.json --token ghp_xxxxxxxxxxxx\n\n# Dry-run mode to preview changes\noctorule --org my-org --settings settings.json --dry-run\n\n# Using GitHub Enterprise\noctorule --org my-org --settings settings.json --base-url https://github.enterprise.com/api/v3\n\n# Only process repositories with names containing 'api' or 'service'\noctorule --org my-org --settings settings.json --name-pattern \"api|service\"\n\n# Only process repositories with the 'active' label\noctorule --org my-org --settings settings.json --label active\n\n# Only process Ruby repositories\noctorule --org my-org --settings settings.json --language ruby\n\n# Only process forked repositories\noctorule --org my-org --settings settings.json --fork\n\n# Only process non-forked repositories\noctorule --org my-org --settings settings.json --no-fork\n\n# Combine multiple filters (repositories must match ALL specified filters)\noctorule --org my-org --settings settings.json --name-pattern \"api\" --language ruby\n```\n\n### Settings File\n\nCreate a JSON file with your desired repository settings. Here's an example:\n\n```json\n{\n  \"repository\": {\n    \"has_issues\": true,\n    \"has_wiki\": false,\n    \"has_projects\": true,\n    \"allow_squash_merge\": true,\n    \"allow_merge_commit\": false,\n    \"allow_rebase_merge\": true,\n    \"delete_branch_on_merge\": true,\n    \"allow_auto_merge\": true,\n    \"allow_update_branch\": true\n  },\n  \"collaborators\": [\n    {\n      \"username\": \"user1\",\n      \"role\": \"admin\"\n    },\n    {\n      \"username\": \"user2\",\n      \"role\": \"write\"\n    }\n  ],\n  \"branch_protection\": {\n    \"main\": {\n      \"enforce_admins\": true,\n      \"required_status_checks\": {\n        \"strict\": true,\n        \"contexts\": [\"ci/build\", \"ci/test\"]\n      },\n      \"required_pull_request_reviews\": {\n        \"required_approving_review_count\": 2,\n        \"dismiss_stale_reviews\": true,\n        \"require_code_owner_reviews\": true\n      },\n      \"allow_force_pushes\": false,\n      \"allow_deletions\": false\n    }\n  },\n  \"files\": [\n    {\n      \"path\": \".gitignore\",\n      \"localPath\": \"./templates/.gitignore\"\n    },\n    {\n      \"path\": \"CONTRIBUTING.md\",\n      \"localPath\": \"./templates/CONTRIBUTING.md\"\n    }\n  ]\n}\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/ecosyste-ms/octorule. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ecosyste-ms/octorule/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nMIT\n\n## Code of Conduct\n\nEveryone interacting in the Octorule project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ecosyste-ms/octorule/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecosyste-ms%2Foctorule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecosyste-ms%2Foctorule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecosyste-ms%2Foctorule/lists"}