Skip to content

Commit

Permalink
Octokit
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobMGEvans committed Sep 4, 2021
1 parent e500959 commit cea0778
Show file tree
Hide file tree
Showing 4 changed files with 451 additions and 7 deletions.
27 changes: 23 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import { Webhooks } from '@octokit/webhooks';
import { Octokit } from '@octokit/rest';

const octokit = new Octokit({
auth: GH_AUTH,
});


addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
Expand All @@ -6,8 +14,19 @@ addEventListener('fetch', event => {
* @param {Request} request
*/
async function handleRequest(request) {
console.log(request.url)
return new Response('Hello worker!', {
headers: { 'content-type': 'text/plain' },
})
const raidsWebhook = new Webhooks({
secret: RAID_HOOK_SECRET,
path: '/raid-hooks',
});
const issues = await octokit.issues.list()

console.log(issues.data)
return new Response(JSON.stringify(issues.data), {

headers: { 'Content-Type': 'application/json' },

})


// raidsWebhook.on('issue.opened', testHook);
}
Loading

0 comments on commit cea0778

Please sign in to comment.