Open Drew-Macgibbon opened 1 year ago
@JapneetRajput I think it would be wise to extract this code:
if (!octokit.value) {
octokit.value = new Octokit({
auth: gh.api_key,
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
}
Into a githubClient.ts
function in the helper
folder, we can have a global ref
in that file to persist the client.
We can then pass any information required for the connection, eg api_key
oktokit repo
We will be using the
graphql
API, this will allow for more granualar control and should allow for more calls per hour than the REST API.This is the project you need to connect to: https://github.com/orgs/incubrain/projects/2
Tasks
createGitHubClient
functionapi/organization/project/repo
from.env
in theplayground
environment tomodule
create/read/update
issues on the project, assigning them to the desired repo