@acuminous/knuff-github-driver
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -11,5 +11,5 @@ export default class GitHubDriver { | ||
const { organisation, name } = repository; | ||
const { owner, name } = repository; | ||
const issues = await this.#octokit.issues.listForRepo({ | ||
owner: organisation, | ||
owner, | ||
repo: name, | ||
@@ -24,6 +24,6 @@ state: 'open', | ||
async createIssue(repository, reminderId, issue) { | ||
const { organisation, name } = repository; | ||
const { owner, name } = repository; | ||
const { title, body, labels = [] } = issue; | ||
return this.#octokit.issues.create({ | ||
owner: organisation, | ||
owner, | ||
repo: name, | ||
@@ -30,0 +30,0 @@ title, |
{ | ||
"name": "@acuminous/knuff-github-driver", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A GitHub driver for Knuff", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,1 +18,8 @@ # knuff-github-driver | ||
``` | ||
### Authentication | ||
GitHub provides multiple authentication methods. The most simple is GitHub Action Token authentication. When run from a GitHub Action, the GITHUB_TOKEN environment variable is automatically set, but only permits Knuff to post issues to the repository that houses the action. | ||
If you need to post to a different repository, and your usage is still moderate, then a fine grained personal access token with read+write issue permissions is the way to go. | ||
If you are using Knuff with lots of teams and repositories, then you may find you are rate limited. In this case your best option is to register a GitHub App and use an installation token, however the token acquisition and refresh process is cumbersome. |
@@ -22,3 +22,3 @@ import { ok, strictEqual as eq } from 'node:assert'; | ||
it('should create issues', async (t) => { | ||
const repository = { organisation: 'acuminous', name: 'knuff-github-driver' }; | ||
const repository = { owner: 'acuminous', name: 'knuff-github-driver' }; | ||
const reminderId = getReminderId(t); | ||
@@ -32,3 +32,3 @@ | ||
it('should find all matching issues', async (t) => { | ||
const repository = { organisation: 'acuminous', name: 'knuff-github-driver' }; | ||
const repository = { owner: 'acuminous', name: 'knuff-github-driver' }; | ||
const reminderId = getReminderId(t); | ||
@@ -45,3 +45,3 @@ | ||
it('should not find closed issues', async (t) => { | ||
const repository = { organisation: 'acuminous', name: 'knuff-github-driver' }; | ||
const repository = { owner: 'acuminous', name: 'knuff-github-driver' }; | ||
const reminderId = getReminderId(t); | ||
@@ -48,0 +48,0 @@ |
9416
25