You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-4Lines changed: 29 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,13 +197,14 @@ This section will go into detail around how you can configure the `issue-db` gem
197
197
198
198
## Authentication 🔒
199
199
200
-
The `issue-db` gem uses the [`Octokit.rb`](https://github.com/octokit/octokit.rb) library under the hood for interactions with the GitHub API. You have three options for authentication when using the `issue-db` gem:
200
+
The `issue-db` gem uses the [`Octokit.rb`](https://github.com/octokit/octokit.rb) library under the hood for interactions with the GitHub API. You have four options for authentication when using the `issue-db` gem:
201
201
202
202
> Note: The order displayed below is also the order of priority that this Gem uses to authenticate.
203
203
204
204
1. Pass in your own authenticated `Octokit.rb` instance to the `IssueDB.new` method
205
-
2. Use a GitHub App by setting the `ISSUE_DB_GITHUB_APP_ID`, `ISSUE_DB_GITHUB_APP_INSTALLATION_ID`, and `ISSUE_DB_GITHUB_APP_KEY` environment variables
206
-
3. Use a GitHub personal access token by setting the `ISSUE_DB_GITHUB_TOKEN` environment variable
205
+
2. Pass GitHub App authentication parameters directly to the `IssueDB.new` method
206
+
3. Use a GitHub App by setting the `ISSUE_DB_GITHUB_APP_ID`, `ISSUE_DB_GITHUB_APP_INSTALLATION_ID`, and `ISSUE_DB_GITHUB_APP_KEY` environment variables
207
+
4. Use a GitHub personal access token by setting the `ISSUE_DB_GITHUB_TOKEN` environment variable
207
208
208
209
> Using a GitHub App is the suggested method
209
210
@@ -218,7 +219,31 @@ require "issue_db"
218
219
db =IssueDB.new("<org>/<repo>") # THAT'S IT! 🎉
219
220
```
220
221
221
-
### Using a GitHub App
222
+
### Using GitHub App Parameters Directly
223
+
224
+
You can now pass GitHub App authentication parameters directly to the `IssueDB.new` method. This is especially useful when you want to manage authentication credentials in your application code or when you have multiple GitHub Apps for different purposes:
225
+
226
+
```ruby
227
+
require"issue_db"
228
+
229
+
# Pass GitHub App credentials directly to IssueDB.new
230
+
db =IssueDB.new(
231
+
"<org>/<repo>",
232
+
app_id:12345, # Your GitHub App ID
233
+
installation_id:56789, # Your GitHub App Installation ID
-`app_id` (Integer) - Your GitHub App ID (found on the App's settings page)
242
+
-`installation_id` (Integer) - Your GitHub App Installation ID (found in the installation URL: `https://github.com/organizations/<org>/settings/installations/<installation_id>`)
243
+
-`app_key` (String) - Your GitHub App private key (can be the key content as a string or a file path ending in `.pem`)
244
+
-`app_algo` (String, optional) - The algorithm to use for JWT signing (defaults to "RS256")
245
+
246
+
### Using a GitHub App with Environment Variables
222
247
223
248
This is the single best way to use the `issue-db` gem because GitHub Apps have increased rate limits, fine-grained permissions, and are more secure than using a personal access token. All you have to do is provide three environment variables and the `issue-db` gem will take care of the rest:
0 commit comments