{"id":15755427,"url":"https://github.com/grantbirki/octokitted","last_synced_at":"2026-03-17T19:20:32.025Z","repository":{"id":194907431,"uuid":"692162515","full_name":"GrantBirki/octokitted","owner":"GrantBirki","description":"A self-hydrating version of Octokit for usage in CI systems - like GitHub Actions!","archived":false,"fork":false,"pushed_at":"2025-03-01T14:46:46.000Z","size":54523,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T17:15:14.604Z","etag":null,"topics":["actions","automation","ci","git","helper","octokit","wrapper"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/octokitted","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/GrantBirki.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-15T17:45:01.000Z","updated_at":"2025-01-14T06:33:11.000Z","dependencies_parsed_at":"2023-12-29T16:41:19.229Z","dependency_job_id":"f9d150da-efbb-49a7-b370-eb6782ed9edb","html_url":"https://github.com/GrantBirki/octokitted","commit_stats":{"total_commits":109,"total_committers":3,"mean_commits":"36.333333333333336","dds":"0.33944954128440363","last_synced_commit":"5ffdd501efa78a9df857898fe46dbe5b824d3dd2"},"previous_names":["grantbirki/octokitted"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Foctokitted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Foctokitted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Foctokitted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrantBirki%2Foctokitted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrantBirki","download_url":"https://codeload.github.com/GrantBirki/octokitted/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243441503,"owners_count":20291482,"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":["actions","automation","ci","git","helper","octokit","wrapper"],"created_at":"2024-10-04T08:21:48.563Z","updated_at":"2026-03-17T19:20:31.992Z","avatar_url":"https://github.com/GrantBirki.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# octokitted\n\n[![test](https://github.com/GrantBirki/octokitted/actions/workflows/test.yml/badge.svg)](https://github.com/GrantBirki/octokitted/actions/workflows/test.yml)\n[![lint](https://github.com/GrantBirki/octokitted/actions/workflows/lint.yml/badge.svg)](https://github.com/GrantBirki/octokitted/actions/workflows/lint.yml)\n[![CodeQL](https://github.com/GrantBirki/octokitted/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/GrantBirki/octokitted/actions/workflows/codeql-analysis.yml)\n[![release](https://github.com/GrantBirki/octokitted/actions/workflows/release.yml/badge.svg)](https://github.com/GrantBirki/octokitted/actions/workflows/release.yml)\n\nA self-hydrating version of Octokit for usage in CI systems - like GitHub Actions!\n\n\u003e **kit** or **kitted** (_verb_)\n\u003e\n\u003e Defintion: provide someone or something with the appropriate clothing or equipment.\n\u003e\n\u003e \"we were all kitted out in life jackets\", \"our octokit client was kitted out for CI usage\"\n\n![octokitted](./docs/assets/dalle.png)\n\n## Installation 💎\n\nYou can download this Gem from either [RubyGems](https://rubygems.org/gems/octokitted) or [GitHub Packages](https://github.com/GrantBirki/octokitted/pkgs/rubygems/octokitted)\n\nRubyGems (Recommended):\n\n```bash\ngem install octokitted\n```\n\n\u003e RubyGems [link](https://rubygems.org/gems/octokitted)\n\nVia a Gemfile:\n\n```ruby\n# frozen_string_literal: true\n\nsource \"https://rubygems.org\"\n\ngem \"octokitted\", \"~\u003e X.X.X\" # Replace X.X.X with the latest version\n```\n\n## Usage 💻\n\nThis section goes over general usage of this Gem\n\nFor full usage documentation of available methods, please see the [docs](./docs/usage.md)\n\n### Configuration\n\nThe following table goes into detail about the configuration options that can be passed into the `Octokitted.new()` constructor:\n\n\u003e It should be noted that when calling `Octokitted.new()` in the proper GitHub Action's context, no configuration is required to be passed into `.new()` because this Gem will fully self-hydrate itself. The `Required` field is only in the table below for reference if you are not running this Gem in GitHub Actions.\n\n| Option | Environment Variable | Description | Required |\n| ------ | -------------------- | ----------- | -------- |\n| `login` | - | The GitHub handle associated with the provided `token`. Defaults to the owner of the token | no |\n| `org` | `GITHUB_REPOSITORY` | The GitHub organization or user that owns a given repository. This value self-hydrates from the `GITHUB_REPOSITORY` env var when run in GitHub Actions | no, can be set after construction |\n| `repo` | `GITHUB_REPOSITORY` | The GitHub repository name. This value self-hydrates from the `GITHUB_REPOSITORY` env var when run in GitHub Actions | no, can be set after construction |\n| `issue_number` | `GITHUB_EVENT_PATH` | The GitHub issue number. This value self-hydrates from the `GITHUB_EVENT_PATH` env var when run in GitHub Actions. The event json object is read from disk on the Action's runner which contains issue number information | no, can be set after construction |\n| `token` | `GITHUB_TOKEN` or `OCTOKIT_ACCESS_TOKEN` | The GitHub token to use for authentication. This value self-hydrates from the `GITHUB_TOKEN` env var when run in GitHub Actions | yes, required for construction |\n| `logger` | - | The logger to use for logging. You can pass in your own logger or use the one this Gem auto-creates by default | no |\n\nIt should be noted that you can configure the log level that is used through the `LOG_LEVEL` environment variable. The default log level is `INFO`.\n\n### GitHub Actions\n\nIf you are running in the context of a **pull request** or an **issue** in GitHub Actions, you can simply create a new instance of `Octokitted` and it will automatically hydrate itself:\n\n```ruby\n# frozen_string_literal: true\n\nrequire \"octokitted\"\n\n# Setup a new instance of Octokitted and self-hydrate\ngh = Octokitted.new()\n\nputs \"#{gh.org} #{gh.repo} #{gh.org_and_repo}\"\n# =\u003e GrantBirki octokitted GrantBirki/octokitted\n\nputs gh.issue_number\n# =\u003e 123\n\n# add a comment to the issue in the context we are running in\ngh.issue.add_comment(\"Hello from Octokitted!\")\n\n# add a label to the issue\ngh.issue.add_labels(labels: [\"test\"])\n\n# remove the label from the issue\ngh.issue.remove_labels(labels: [\"test\"])\n\n# close the issue\ngh.issue.close\n\n# swap your context to a different issue\ngh.issue_number = 456\nputs gh.issue_number\n# =\u003e 456\n\n```\n\n### Outside of GitHub Actions\n\nIf you want to use Octokitted outside of GitHub Actions, you can pass some of the required information to the constructor:\n\n```ruby\n# frozen_string_literal: true\n\nrequire \"octokitted\"\n\n# Setup a new instance of Octokitted with explicit values\ngh = Octokitted.new(\n    login: \"GrantBirki\", # The user associated with the GITHUB_TOKEN\n    org: \"GrantBirki\", # The organization associated with the repo\n    repo: \"octokitted\", # The repo name\n    token: ENV.fetch(\"GITHUB_TOKEN\"), # The GitHub token to use\n    issue_number: 123 # The issue number to use\n)\n\n# Now you have an octokitted client that is hydrated and ready to use just as seen in the more detailed example above!\n\nputs \"#{gh.org} #{gh.repo} #{gh.org_and_repo}\"\n# =\u003e GrantBirki octokitted GrantBirki/octokitted\n\nputs gh.issue_number\n# =\u003e 123\n\n# ...\n```\n\n### Native Git Usage\n\nIf you system / container has the `git` binary installed, you can also use this Gem to run native Git commands:\n\n```ruby\n# frozen_string_literal: true\n\nrequire \"octokitted\"\n\n# Setup a new instance of Octokitted with explicit values\ngh = Octokitted.new(\n    login: \"GrantBirki\", # The user associated with the GITHUB_TOKEN\n    org: \"GrantBirki\", # The organization associated with the repo\n    repo: \"octokitted\", # The repo name\n    token: ENV.fetch(\"GITHUB_TOKEN\") # The GitHub token to use\n)\n\n# Check to see if there are any cloned repos\nputs gh.cloned_repos\n# =\u003e []\n\n# Clone the repo we setup our client with and get back a Git::Base object\ngit = gh.clone\n\n# Check again to see that we have one locally cloned repo at the path displayed\nputs gh.cloned_repos\n# =\u003e [\"./octokitted\"]\n\ngit.checkout(\"new_branch\", new_branch: true, start_point: \"main\")\n\ngit.add # git add -- \".\"\n# git.add(:all=\u003etrue) # git add --all -- \".\"\n# git.add(\"file_path\") # git add -- \"file_path\"\n# git.add([\"file_path_1\", \"file_path_2\"])\n\ngit.commit(\"message\")\n# git.commit_all(\"message\")\n\ngit.push\n# git.push(git.remote(\"name\"))\n\n# remove the repo we just cloned\ngh.remove_all_clones!\n\nputs gh.cloned_repos\n# =\u003e []\n```\n\n\u003e Read more about the native Git Ruby Gem [here](https://github.com/ruby-git/ruby-git)\n\n## Release 🚀\n\nTo release a new version of this gem, simply edit the [`lib/version.rb`](lib/version.rb) in this repo. When you commit your changes to `main`, a new version will be automatically released via GitHub Actions to RubyGems and GitHub Packages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantbirki%2Foctokitted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantbirki%2Foctokitted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantbirki%2Foctokitted/lists"}