{"id":21202518,"url":"https://github.com/infrablocks/rake_github","last_synced_at":"2025-07-10T06:33:02.986Z","repository":{"id":37838048,"uuid":"245911043","full_name":"infrablocks/rake_github","owner":"infrablocks","description":"Rake tasks for managing Github repositories.","archived":false,"fork":false,"pushed_at":"2025-05-27T18:08:49.000Z","size":389,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-27T19:23:01.398Z","etag":null,"topics":["github","github-config","github-configuration","infrablocks","rake","rake-task","rake-taskset","ruby","ruby-gem","rubygem","taskset"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infrablocks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2020-03-09T00:30:17.000Z","updated_at":"2025-05-27T18:08:51.000Z","dependencies_parsed_at":"2023-11-13T19:58:40.896Z","dependency_job_id":"ace11a27-e284-4645-82e6-6d86211264b4","html_url":"https://github.com/infrablocks/rake_github","commit_stats":{"total_commits":149,"total_committers":4,"mean_commits":37.25,"dds":0.6644295302013423,"last_synced_commit":"62812bb72a3efad9d455768e88e7310beed1910d"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/infrablocks/rake_github","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Frake_github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Frake_github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Frake_github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Frake_github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infrablocks","download_url":"https://codeload.github.com/infrablocks/rake_github/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infrablocks%2Frake_github/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264538585,"owners_count":23624436,"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":["github","github-config","github-configuration","infrablocks","rake","rake-task","rake-taskset","ruby","ruby-gem","rubygem","taskset"],"created_at":"2024-11-20T20:16:41.142Z","updated_at":"2025-07-10T06:33:02.407Z","avatar_url":"https://github.com/infrablocks.png","language":"Ruby","readme":"# RakeGithub\n\nRake tasks for managing Github repositories.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'rake_github'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rake_github\n\n## Usage\n\n### define_deploy_keys_tasks\n\n### define_repository_tasks\n\nSets up rake tasks for managing deploy keys and merging pull requests.\n\n```ruby\nrequire 'rake_github'\n\nRakeGithub.define_repository_tasks(\n  namespace: :github,\n  repository: 'org/repo', # required\n) do |t|\n  t.access_token = \"your_github_access_token\" # required\n  t.deploy_keys = [\n    {\n      title: 'CircleCI',\n      public_key: File.read('path/to/your_deploy_key.public')\n    }\n  ]\nend\n```\n\n| Parameter                       | Type   | Required | Description                                                | Example                                                | Default                              |\n|---------------------------------|--------|----------|------------------------------------------------------------|--------------------------------------------------------|--------------------------------------|\n| repository                      | string | Y        | Repository to perform tasks upon                           | 'organisation/repository_name'                         | N/A                                  |\n| access_token                    | string | Y        | Github token for authorisation                             | 'ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'            | N/A                                  |\n| deploy_keys                     | array  | N        | Keys to deploy to repository                               | { title: string, public_key: string, read_only: bool } | [ ]                                  |\n| deploy_keys_namespace           | symbol | N        | Namespace to contain deploy keys tasks                     | :deploy_tasks                                          | :deploy_keys                         |\n| deploy_keys_destroy_task_name   | symbol | N        | Option to change the destroy task name                     | :obliterate                                            | :destroy                             |\n| deploy_keys_provision_task_name | symbol | N        | Option to change the provision task name                   | :add                                                   | :provision                           |\n| deploy_keys_ensure_task_name    | symbol | N        | Option to change the ensure task name                      | :destroy_and_provision                                 | :ensure                              |\n| namespace                       | symbol | N        | Namespace for tasks to live in, defaults to root namespace | :rake_github                                           | N/A                                  |\n\nExposes tasks:\n\n```shell\n$ rake -T\n\nrake github:deploy_keys:destroy\nrake github:deploy_keys:ensure\nrake github:deploy_keys:provision\nrake github:pull_requests:merge[branch_name,commit_message]\n```\n\n#### deploy_keys:provision\n\nProvisions deploy keys to the specified repository.\n\n#### deploy_keys:destroy\n\nDestroys deploy keys from the specified repository.\n\n#### deploy_keys:ensure\n\nDestroys and then provisions deploy keys on the specified repository.\n\n#### pull_requests:merge[branch_name,commit_message]\n\nMerges the PR associated with the `branch_name`. Branch name is required.\n\n`commit_message` is optional, and can contain the original commit message with\nthe `%s` placeholder, e.g. `pull_requests:merge[new_feature,\"%s [skip ci]\"]`.\n\n### define_release_task\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`rake spec` to run the tests. You can also run `bin/console` for an interactive\nprompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n### Managing CircleCI keys\n\nTo encrypt a GPG key for use by CircleCI:\n\n```bash\nopenssl aes-256-cbc \\\n  -e \\\n  -md sha1 \\\n  -in ./config/secrets/ci/gpg.private \\\n  -out ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\nTo check decryption is working correctly:\n\n```bash\nopenssl aes-256-cbc \\\n  -d \\\n  -md sha1 \\\n  -in ./.circleci/gpg.private.enc \\\n  -k \"\u003cpassphrase\u003e\"\n```\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/infrablocks/rake_github. This project is intended to be a\nsafe, welcoming space for collaboration, and contributors are expected to adhere\nto the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Frake_github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfrablocks%2Frake_github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfrablocks%2Frake_github/lists"}